- Timestamp:
- 06/13/12 09:01:31 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Selection/3.3/WorstSelector.cs
r7259 r7995 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; … … 51 52 52 53 // create a list for each scope that contains the scope's index in the original scope list 53 var temp = qualities. Select((x, index) => new { index, x.Value });54 var temp = qualities.Where(x => IsValidQuality(x.Value)).Select((x, index) => new { index, x.Value }); 54 55 if (maximization) 55 56 temp = temp.OrderBy(x => x.Value); … … 57 58 temp = temp.OrderByDescending(x => x.Value); 58 59 var list = temp.ToList(); 60 61 //check if list with indexes is as long as the original scope list 62 //otherwise invalid quality values were filtered 63 if (list.Count != scopes.Count) { 64 throw new ArgumentException("The scopes contain invalid quality values (either infinity or double.NaN) on which the selector cannot operate."); 65 } 59 66 60 67 if (copy) {
Note: See TracChangeset
for help on using the changeset viewer.