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.Problems.ExternalEvaluation/3.4/SingleObjectiveExternalEvaluationProblem.cs

    r17363 r17382  
    105105
    106106    #region Single Objective Problem Overrides
    107     public override double Evaluate(TEncodedSolution solution, IRandom random, CancellationToken cancellationToken) {
     107    public override ISingleObjectiveEvaluationResult Evaluate(TEncodedSolution solution, IRandom random, CancellationToken cancellationToken) {
    108108      var qualityMessage = Evaluate(BuildSolutionMessage(solution), cancellationToken);
    109109      if (!qualityMessage.HasExtension(SingleObjectiveQualityMessage.QualityMessage_))
    110110        throw new InvalidOperationException("The received message is not a SingleObjectiveQualityMessage.");
    111       return qualityMessage.GetExtension(SingleObjectiveQualityMessage.QualityMessage_).Quality;
     111      var quality = qualityMessage.GetExtension(SingleObjectiveQualityMessage.QualityMessage_).Quality;
     112      return new SingleObjectiveEvaluationResult(quality);
     113
    112114    }
    113115    public virtual QualityMessage Evaluate(SolutionMessage solutionMessage, CancellationToken cancellationToken) {
Note: See TracChangeset for help on using the changeset viewer.