Changeset 11363 for branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveScript.cs
- Timestamp:
- 09/15/14 10:23:34 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveScript.cs
r10856 r11363 34 34 protected SingleObjectiveScript(SingleObjectiveScript original, Cloner cloner) 35 35 : base(original, cloner) { } 36 public SingleObjectiveScript() { } 36 37 public SingleObjectiveScript() { 38 Code = CodeTemplate; 39 } 37 40 38 41 public override IDeepCloneable Clone(Cloner cloner) { … … 78 81 } 79 82 83 public IEnumerable<ParameterVector> GetNeighbors(IRandom random, ParameterVector vector) { 84 // Create new vectors, based on the given one that represent small changes 85 // This method is only called from move-based algorithms (LocalSearch, SimulatedAnnealing, etc.) 86 while (true) { 87 var neighbor = (ParameterVector)vector.Clone(); 88 //e.g. make a bit flip in a binary parameter 89 //var bIndex = random.Next(neighbor.Binary(""b"").Length); 90 //neighbor.Binary(""b"")[bIndex] = !neighbor.Binary(""b"")[bIndex]; 91 yield return neighbor; 92 } 93 } 94 80 95 // implement further classes and methods 81 96 }";
Note: See TracChangeset
for help on using the changeset viewer.