Changeset 13372 for branches/ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/CompiledSingleObjectiveOptimizationSupport.cs
- Timestamp:
- 11/24/15 17:22:41 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/Programmable/CompiledSingleObjectiveOptimizationSupport.cs
r13257 r13372 6 6 public class CompiledSingleObjectiveOptimizationSupport : CompiledOptimizationSupport, ISingleObjectiveOptimizationSupport { 7 7 8 public void Analyze(I ndividual[] individuals, double[] qualities, ResultCollection results, IRandom random) {8 public void Analyze(ISolution[] individuals, double[] qualities, ResultCollection results, IRandom random) { 9 9 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 10 10 // Write or update results given the range of vectors and resulting qualities … … 17 17 } 18 18 19 public IEnumerable<I ndividual> GetNeighbors(Individualindividual, IRandom random) {19 public IEnumerable<ISolution> GetNeighbors(ISolution individual, IRandom random) { 20 20 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 21 21 // Create new vectors, based on the given one that represent small changes … … 24 24 // Algorithm will draw only a finite amount of samples 25 25 // Change to a for-loop to return a concrete amount of neighbors 26 var neighbor = individual.Copy();26 var neighbor = (ISolution)individual.Clone(); 27 27 // For instance, perform a single bit-flip in a binary parameter 28 28 //var bIndex = random.Next(neighbor.BinaryVector("b").Length);
Note: See TracChangeset
for help on using the changeset viewer.