Changeset 11667 for branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/LinkageCrossover.cs
- Timestamp:
- 12/06/14 16:58:02 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/LinkageCrossover.cs
r11666 r11667 57 57 if (changed) { 58 58 double newFitness = problem.Evaluate(solution); 59 if (problem.IsBetter(newFitness, fitness)) { 60 // improvement made, keep change to solution 61 fitness = newFitness; 62 } else { 63 // revert solution 59 // if the original is strictly better, revert the change 60 if (problem.IsBetter(fitness, newFitness)) { 64 61 foreach (var index in flipped) { 65 62 solution[index] = !solution[index]; 66 63 } 64 } else { 65 // new solution is no worse than original, keep change to solution 66 fitness = newFitness; 67 67 } 68 68 }
Note: See TracChangeset
for help on using the changeset viewer.