Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/20/15 20:25:00 (9 years ago)
Author:
gkronber
Message:

#2283: separated value-states from done-states in GenericGrammarPolicy and removed disabling of actions from bandit policies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/BanditPolicies/UCB1Policy.cs

    r11747 r11806  
    1313      var myActionInfos = actionInfos.OfType<DefaultPolicyActionInfo>();
    1414      double bestQ = double.NegativeInfinity;
    15       int totalTries = myActionInfos.Where(a => !a.Disabled).Sum(a => a.Tries);
     15      int totalTries = myActionInfos.Sum(a => a.Tries);
    1616
    1717      var bestActions = new List<int>();
     
    1919      foreach (var aInfo in myActionInfos) {
    2020        aIdx++;
    21         if (aInfo.Disabled) continue;
    2221        double q;
    2322        if (aInfo.Tries == 0) {
     
    3130          bestActions.Clear();
    3231          bestActions.Add(aIdx);
    33         } else if (q == bestQ) {
     32        } else if (q.IsAlmost(bestQ)) {
    3433          bestActions.Add(aIdx);
    3534        }
Note: See TracChangeset for help on using the changeset viewer.