Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/10/17 21:36:03 (7 years ago)
Author:
pkimmesw
Message:

#2665 Fixed small issues, testet benchmark suite, added INX Expressions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Configuration/PushConfigurationBase.cs

    r15032 r15189  
    4848      set
    4949      {
    50         var removedExpressions = enabledExpressions.ToArray();
     50        var removedExpressions = enabledExpressions.ToList();
    5151        enabledExpressions.Clear();
    5252        enabledExpressions.AddRange(value);
     
    6868        var attribute = ExpressionTable.TypeToAttributeTable[type];
    6969
    70         expressionsPerStackCount[attribute.StackType]++;
     70        if (expressionsPerStackCount.ContainsKey(attribute.StackType)) {
     71          expressionsPerStackCount[attribute.StackType]++;
     72        }
    7173
    7274        foreach (var additionalStackType in attribute.AdditionalStackDependencies.ToValues())
     
    150152
    151153      enabledExpressions.Add(expressionName);
    152       expressionsPerStackCount[attribute.StackType]++;
    153       foreach (var additionalStackType in attribute.AdditionalStackDependencies.ToValues())
     154
     155      if (expressionsPerStackCount.ContainsKey(attribute.StackType))
     156        expressionsPerStackCount[attribute.StackType]++;
     157
     158      foreach (var additionalStackType in attribute.AdditionalStackDependencies.ToValues().Where(expressionsPerStackCount.ContainsKey))
    154159        expressionsPerStackCount[additionalStackType]++;
    155160
     
    172177
    173178      enabledExpressions.Remove(expressionName);
    174       expressionsPerStackCount[attribute.StackType]--;
    175       foreach (var additionalStackType in attribute.AdditionalStackDependencies.ToValues())
     179
     180      if (expressionsPerStackCount.ContainsKey(attribute.StackType))
     181        expressionsPerStackCount[attribute.StackType]--;
     182
     183      foreach (var additionalStackType in attribute.AdditionalStackDependencies.ToValues().Where(expressionsPerStackCount.ContainsKey))
    176184        expressionsPerStackCount[additionalStackType]--;
    177185
Note: See TracChangeset for help on using the changeset viewer.