Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/13/12 09:01:31 (12 years ago)
Author:
mkommend
Message:

#1871: Added quality checks in all SingleObjectiveSelectors.

File:
1 edited

Legend:

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

    r7259 r7995  
    6969      // prepare qualities for proportional selection
    7070      var qualities = QualityParameter.ActualValue.Select(x => x.Value);
     71      //check if list with indexes is as long as the original scope list
     72      //otherwise invalid quality values were filtered
     73      if (!qualities.All(IsValidQuality)) {
     74        throw new ArgumentException("The scopes contain invalid quality values (either infinity or double.NaN) on which the selector cannot operate.");
     75      }
     76
    7177      double minQuality = qualities.Min();
    7278      double maxQuality = qualities.Max();
Note: See TracChangeset for help on using the changeset viewer.