Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/18/17 01:15:25 (8 years ago)
Author:
pkimmesw
Message:

#2665 BenchmarkSuite, all examples, partially tested, VectorExpressions added

Location:
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Configuration
Files:
2 edited

Legend:

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

    r14834 r14875  
    33
    44  using HeuristicLab.Common;
    5   using HeuristicLab.Problems.ProgramSynthesis.Push.Erc.Interfaces;
     5  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Interfaces;
    66  using HeuristicLab.Problems.ProgramSynthesis.Push.Stack;
    77
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Configuration/PushConfiguration.cs

    r14834 r14875  
    44  using System.Linq;
    55  using Attributes;
     6  using Base.Erc;
     7  using Base.Erc.Interfaces;
    68  using Common;
    79  using Core;
    8   using Erc;
    9   using Erc.Interfaces;
    1010  using Expressions;
    1111  using Persistence.Default.CompositeSerializers.Storable;
     
    2121
    2222      enabledExpressions = ExpressionTable.ExpressionNames.ToList();
    23       EnabledStacks = new Dictionary<StackTypes, bool>();
     23      enabledStacks = new Dictionary<StackTypes, bool>();
    2424
    2525      ErcOptions = new ErcOptions();
     
    3838    private void InitEnabledStacks(bool state = true) {
    3939      foreach (StackTypes type in Enum.GetValues(typeof(StackTypes))) {
    40         if (!EnabledStacks.ContainsKey(type))
    41           EnabledStacks.Add(type, state);
     40        if (!enabledStacks.ContainsKey(type))
     41          enabledStacks.Add(type, state);
    4242      }
    4343    }
     
    5050    public PushConfiguration(PushConfiguration origin, Cloner cloner) : base(origin, cloner) {
    5151      enabledExpressions = origin.EnabledExpressions.ToList();
    52       EnabledStacks = origin.EnabledStacks.ToDictionary(x => x.Key, x => x.Value);
     52      enabledStacks = origin.EnabledStacks.ToDictionary(x => x.Key, x => x.Value);
    5353
    5454      ErcOptions = cloner.Clone(origin.ErcOptions);
     
    7070    }
    7171
    72     [Storable]
    73     public IDictionary<StackTypes, bool> EnabledStacks { get; set; }
    74 
    75     IReadOnlyDictionary<StackTypes, bool> IReadOnlyPushConfiguration.EnabledStacks { get { return EnabledStacks as IReadOnlyDictionary<StackTypes, bool>; } }
     72
     73    [Storable]
     74    private Dictionary<StackTypes, bool> enabledStacks;
     75
     76    public IReadOnlyDictionary<StackTypes, bool> EnabledStacks { get { return enabledStacks; } }
    7677
    7778    public event EventHandler<EnabledExpressionsChangedEventArgs> EnabledExpressionsChanged;
     
    9596    }
    9697
    97     IReadOnlyList<string> IReadOnlyPushConfiguration.EnabledExpressions { get { return EnabledExpressions as IReadOnlyList<string>; } }
     98    IReadOnlyList<string> IReadOnlyPushConfiguration.EnabledExpressions { get { return enabledExpressions; } }
    9899
    99100    [Storable]
     
    189190        var type = ExpressionTable.TypeToNameTable.Single(x => x.Value == name).Key;
    190191        var attribute = ExpressionTable.TypeToAttributeTable[type];
    191         EnabledStacks[attribute.StackType] = true;
     192        enabledStacks[attribute.StackType] = true;
    192193      }
    193194
     
    207208        var type = ExpressionTable.TypeToNameTable.Single(x => x.Value == name).Key;
    208209        var attribute = ExpressionTable.TypeToAttributeTable[type];
    209         EnabledStacks[attribute.StackType] = false;
     210        enabledStacks[attribute.StackType] = false;
    210211      }
    211212
     
    238239
    239240    public void EnableStack(StackTypes type, bool enableExpressions = false) {
    240       EnabledStacks[type] = true;
     241      enabledStacks[type] = true;
    241242
    242243      if (enableExpressions)
     
    245246
    246247    public void DisableStack(StackTypes type, bool disableExpressions = false) {
    247       EnabledStacks[type] = false;
     248      enabledStacks[type] = false;
    248249
    249250      if (disableExpressions)
Note: See TracChangeset for help on using the changeset viewer.