Changeset 12000
- Timestamp:
- 02/13/15 12:55:38 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.Binary/3.3/BinaryProblem.cs
r11996 r12000 75 75 public override void Analyze(Individual[] individuals, double[] qualities, ResultCollection results, IRandom random) { 76 76 base.Analyze(individuals, qualities, results, random); 77 var best = individuals.Zip(qualities, (i, q) => new { Individual = i, Quality = q }).OrderByDescending(z => z.Quality).First(); 77 var orderedIndividuals = individuals.Zip(qualities, (i, q) => new { Individual = i, Quality = q }).OrderBy(z => z.Quality); 78 var best = Maximization ? orderedIndividuals.Last().Individual : orderedIndividuals.First().Individual; 79 78 80 if (!results.ContainsKey("Best Solution")) { 79 81 results.Add(new Result("Best Solution", typeof(BinaryVector))); 80 82 } 81 results["Best Solution"].Value = best.Individual.BinaryVector();83 results["Best Solution"].Value = (IItem)best.BinaryVector().Clone(); 82 84 } 83 85
Note: See TracChangeset
for help on using the changeset viewer.