Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/13/19 22:56:49 (6 years ago)
Author:
abeham
Message:

#2521: Refactor Analyze method of encoding-specific problems, simplify Analyze of SO-TF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.LinearLinkageEncoding/3.4/LinearLinkageProblem.cs

    r16948 r16950  
    6363    }
    6464
    65     public override void Analyze(LinearLinkage[] individuals, double[] qualities, ResultCollection results, IRandom random) {
    66       base.Analyze(individuals, qualities, results, random);
    67       var orderedIndividuals = individuals.Zip(qualities, (i, q) => new { Individual = i, Quality = q }).OrderBy(z => z.Quality);
    68       var best = Maximization ? orderedIndividuals.Last().Individual : orderedIndividuals.First().Individual;
     65    public override void Analyze(LinearLinkage[] vectors, double[] qualities, ResultCollection results, IRandom random) {
     66      base.Analyze(vectors, qualities, results, random);
     67      var best = GetBestSolution(vectors, qualities);
    6968
    70       results.AddOrUpdateResult("Best Solution", (Item)best.Clone());
     69      results.AddOrUpdateResult("Best Solution", (Item)best.Item1.Clone());
    7170    }
    7271
Note: See TracChangeset for help on using the changeset viewer.