Changeset 1743 for trunk/sources/HeuristicLab.Selection.Uncertainty/v3.2/UncertainTournamentSelector.cs
- Timestamp:
- 05/06/09 16:51:10 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Selection.Uncertainty/v3.2/UncertainTournamentSelector.cs
r1742 r1743 28 28 using HeuristicLab.Selection; 29 29 using HeuristicLab.StatisticalAnalysis; 30 using HeuristicLab.Tracing; 30 31 31 32 namespace HeuristicLab.Selection.Uncertainty { … … 54 55 double alpha = GetVariableValue<DoubleData>("SignificanceLevel", source, true).Data; 55 56 57 int insignificantCount = 0; 58 int equalRankListSize = 0; 56 59 for (int i = 0; i < selected; i++) { 57 60 if (source.SubScopes.Count < 1) throw new InvalidOperationException("No source scopes available to select."); … … 97 100 } 98 101 } 99 // else there's a statistical significant difference, but equal average qualities... can that happen? 102 // else there's a statistical significant difference, but equal average qualities... can that happen? in any case, nobody gets a rank increase 100 103 } 101 104 } 102 105 } 103 106 int selectedScopeIndex = 0; 104 if (equalRankList.Count == 0) 107 if (equalRankList.Count == 0) { 108 insignificantCount++; 105 109 selectedScopeIndex = tournamentGroupIndices[random.Next(groupSize)]; // no significance in all the solutions, select one randomly 106 else 110 } else { 111 equalRankListSize += equalRankList.Count; 107 112 selectedScopeIndex = tournamentGroupIndices[equalRankList[random.Next(equalRankList.Count)]]; // select among those with the highest rank randomly 108 113 } 109 114 IScope selectedScope = source.SubScopes[selectedScopeIndex]; 110 115 … … 116 121 } 117 122 } 123 Logger.Debug("Solutions selected: " + selected + ". Completely random selections: " + insignificantCount + ". Average size of highest rank pool: " + (double)equalRankListSize / (double)selected); 118 124 } 119 125 }
Note: See TracChangeset
for help on using the changeset viewer.