Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/18/19 16:11:21 (5 years ago)
Author:
mkommend
Message:

#2521: Refactored single-objective problems to use EvaluationResult instead of double as return type from Evaluate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HillClimber.cs

    r17226 r17382  
    2525using System.Linq;
    2626using System.Threading;
     27using HEAL.Attic;
    2728using HeuristicLab.Common;
    2829using HeuristicLab.Core;
     
    3132using HeuristicLab.Optimization;
    3233using HeuristicLab.Parameters;
    33 using HEAL.Attic;
    3434using HeuristicLab.Random;
    3535
     
    110110        }
    111111
    112         var fitness = Problem.Evaluate(solution, random);
     112        var evaluationResult = Problem.Evaluate(solution, random);
     113        var fitness = evaluationResult.Quality;
    113114
    114115        fitness = ImproveToLocalOptimum(Problem, solution, fitness, random);
     
    128129          if (tried.Contains(option)) continue;
    129130          solution[option] = !solution[option];
    130           double newFitness = problem.Evaluate(solution, rand);
     131          var newEvaluationResult = problem.Evaluate(solution, rand);
     132          double newFitness = newEvaluationResult.Quality;
    131133          if (problem.IsBetter(newFitness, fitness)) {
    132134            fitness = newFitness;
Note: See TracChangeset for help on using the changeset viewer.