Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/06/09 16:51:10 (15 years ago)
Author:
abeham
Message:

Adding log messages to evaluate if this works at all (#611)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Selection.Uncertainty/v3.2/UncertainTournamentSelector.cs

    r1742 r1743  
    2828using HeuristicLab.Selection;
    2929using HeuristicLab.StatisticalAnalysis;
     30using HeuristicLab.Tracing;
    3031
    3132namespace HeuristicLab.Selection.Uncertainty {
     
    5455      double alpha = GetVariableValue<DoubleData>("SignificanceLevel", source, true).Data;
    5556
     57      int insignificantCount = 0;
     58      int equalRankListSize = 0;
    5659      for (int i = 0; i < selected; i++) {
    5760        if (source.SubScopes.Count < 1) throw new InvalidOperationException("No source scopes available to select.");
     
    97100                }
    98101              }
    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
    100103            }
    101104          }
    102105        }
    103106        int selectedScopeIndex = 0;
    104         if (equalRankList.Count == 0)
     107        if (equalRankList.Count == 0) {
     108          insignificantCount++;
    105109          selectedScopeIndex = tournamentGroupIndices[random.Next(groupSize)]; // no significance in all the solutions, select one randomly
    106         else
     110        } else {
     111          equalRankListSize += equalRankList.Count;
    107112          selectedScopeIndex = tournamentGroupIndices[equalRankList[random.Next(equalRankList.Count)]]; // select among those with the highest rank randomly
    108 
     113        }
    109114        IScope selectedScope = source.SubScopes[selectedScopeIndex];
    110115
     
    116121        }
    117122      }
     123      Logger.Debug("Solutions selected: " + selected + ". Completely random selections: " + insignificantCount + ". Average size of highest rank pool: " + (double)equalRankListSize / (double)selected);
    118124    }
    119125  }
Note: See TracChangeset for help on using the changeset viewer.