Changeset 11666 for branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/LinkageCrossover.cs
- Timestamp:
- 12/05/14 18:25:03 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/LinkageCrossover.cs
r11663 r11666 30 30 public static class LinkageCrossover { 31 31 32 public static double ImproveUsingTree(LinkageTree tree, IList<bool[]> donors, bool[] solution, double fitness, BinaryVectorProblem problem, IRandom rand) {32 public static double ImproveUsingTree(LinkageTree tree, IList<bool[]> donors, bool[] solution, double fitness, IBinaryVectorProblem problem, IRandom rand) { 33 33 var options = Enumerable.Range(0, donors.Count).ToArray(); 34 34 foreach (var cluster in tree.Clusters) { … … 36 36 // from the current solution for this cluster of genes 37 37 bool donorFound = false; 38 foreach (var donorIndex in options.Shuffle (rand)) {38 foreach (var donorIndex in options.ShuffleList(rand)) { 39 39 // Attempt the donation 40 40 fitness = Donate(solution, fitness, donors[donorIndex], cluster, problem, out donorFound); … … 45 45 } 46 46 47 private static double Donate(bool[] solution, double fitness, bool[] source, IEnumerable<int> cluster, BinaryVectorProblem problem, out bool changed) {47 private static double Donate(bool[] solution, double fitness, bool[] source, IEnumerable<int> cluster, IBinaryVectorProblem problem, out bool changed) { 48 48 // keep track of which bits flipped to make the donation 49 49 List<int> flipped = new List<int>();
Note: See TracChangeset
for help on using the changeset viewer.