Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/10 05:24:03 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • corrected several bugs in order to get SGA working
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Selection/3.3/TournamentSelector.cs

    r2817 r2818  
    2121
    2222using System.Collections.Generic;
     23using System.Linq;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    4849      IRandom random = RandomParameter.ActualValue;
    4950      bool maximization = MaximizationParameter.ActualValue.Value;
    50       List<DoubleData> qualities = new List<DoubleData>(QualityParameter.ActualValue);
     51      List<double> qualities = QualityParameter.ActualValue.Select(x => x.Value).ToList();
    5152      int groupSize = GroupSizeParameter.ActualValue.Value;
    5253      ScopeList selected = new ScopeList();
     
    5758        for (int j = 1; j < groupSize; j++) {
    5859          index = random.Next(scopes.Count);
    59           if (((maximization) && (qualities[index].Value > qualities[best].Value)) ||
    60               ((!maximization) && (qualities[index].Value < qualities[best].Value))) {
     60          if (((maximization) && (qualities[index] > qualities[best])) ||
     61              ((!maximization) && (qualities[index] < qualities[best]))) {
    6162            best = index;
    6263          }
Note: See TracChangeset for help on using the changeset viewer.