Changeset 13183 for trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/CompiledMultiObjectiveOptimizationSupport.cs
- Timestamp:
- 11/16/15 18:55:07 (8 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/CompiledMultiObjectiveOptimizationSupport.cs
r13166 r13183 8 8 9 9 namespace HeuristicLab.Problems.ExternalEvaluation { 10 public class Compiled SingleObjectiveOptimizationSupport : CompiledOptimizationSupport, ISingleObjectiveOptimizationSupport {10 public class CompiledMultiObjectiveOptimizationSupport : CompiledOptimizationSupport, IMultiObjectiveOptimizationSupport { 11 11 12 public void Analyze(Individual[] individuals, double[] qualities, ResultCollection results, IRandom random) {12 public void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) { 13 13 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 14 14 // Write or update results given the range of vectors and resulting qualities … … 20 20 } 21 21 22 public IEnumerable<Individual> GetNeighbors(Individual individual, IRandom random) {23 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable24 // Create new vectors, based on the given one that represent small changes25 // This method is only called from move-based algorithms (Local Search, Simulated Annealing, etc.)26 while (true) {27 // Algorithm will draw only a finite amount of samples28 // Change to a for-loop to return a concrete amount of neighbors29 var neighbor = individual.Copy();30 // For instance, perform a single bit-flip in a binary parameter31 //var bIndex = random.Next(neighbor.BinaryVector("b").Length);32 //neighbor.BinaryVector("b")[bIndex] = !neighbor.BinaryVector("b")[bIndex];33 yield return neighbor;34 }35 }36 37 22 // Implement further classes and methods 38 23 } 39 24 } 40
Note: See TracChangeset
for help on using the changeset viewer.