Ignore:
Timestamp:
12/04/15 10:35:04 (5 years ago)
Author:
mkommend
Message:

#2521: Intermediate version of schedule encoding refactoring.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/Analyzers/BestSchedulingSolutionAnalyzer.cs

    r12012 r13435  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using System.Linq;
    2324using HeuristicLab.Common;
     
    7778      if (bestSolution == null) {
    7879        bestSolution = (Schedule)solutions[i].Clone();
    79         bestSolution.Quality = (DoubleValue)qualities[i].Clone();
     80        bestSolution.Quality = qualities[i].Value;
    8081        BestSolutionParameter.ActualValue = bestSolution;
    8182        results.Add(new Result("Best Scheduling Solution", bestSolution));
    8283      } else {
    83         if (max && bestSolution.Quality.Value < qualities[i].Value ||
    84           !max && bestSolution.Quality.Value > qualities[i].Value) {
    85           bestSolution.Quality.Value = qualities[i].Value;
    86           bestSolution.Resources = (ItemList<Resource>)solutions[i].Resources.Clone();
     84        if (max && bestSolution.Quality < qualities[i].Value ||
     85          !max && bestSolution.Quality > qualities[i].Value) {
     86          bestSolution.Quality = qualities[i].Value;
     87          bestSolution.Resources.Clear();
     88          bestSolution.Resources.AddRange((IEnumerable<Resource>)solutions[i].Resources.Clone());
    8789        }
    8890      }
Note: See TracChangeset for help on using the changeset viewer.