Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/20 14:44:19 (4 years ago)
Author:
abeham
Message:

#2521: working on refactoring

Location:
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/Boolean
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/Boolean/EvenParityProblem.cs

    r17655 r17778  
    3939  public sealed class EvenParityProblem : SymbolicExpressionTreeProblem {
    4040
    41     #region parameter names
    42     private const string NumberOfBitsParameterName = "NumberOfBits";
    43     #endregion
    44 
    4541    #region Parameter Properties
    46     public IFixedValueParameter<IntValue> NumberOfBitsParameter {
    47       get { return (IFixedValueParameter<IntValue>)Parameters[NumberOfBitsParameterName]; }
    48     }
     42    [Storable] public IFixedValueParameter<IntValue> NumberOfBitsParameter { get; private set; }
    4943    #endregion
    5044
     
    6862    private EvenParityProblem(EvenParityProblem original, Cloner cloner)
    6963      : base(original, cloner) {
     64      NumberOfBitsParameter = cloner.Clone(original.NumberOfBitsParameter);
    7065      RegisterEventHandlers();
    7166    }
     
    7873      : base(new SymbolicExpressionTreeEncoding()) {
    7974      Maximization = true;
    80       Parameters.Add(new FixedValueParameter<IntValue>(NumberOfBitsParameterName, "The number of bits for the input parameter for the even parity function", new IntValue(4)));
     75      Parameters.Add(NumberOfBitsParameter = new FixedValueParameter<IntValue>("NumberOfBits", "The number of bits for the input parameter for the even parity function", new IntValue(4)));
    8176
    8277      Encoding.TreeLength = 100;
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/Boolean/MultiplexerProblem.cs

    r17655 r17778  
    4141  public sealed class MultiplexerProblem : SymbolicExpressionTreeProblem {
    4242
    43     #region parameter names
    44     private const string NumberOfBitsParameterName = "NumberOfBits";
    45     #endregion
    46 
    4743    #region Parameter Properties
    48     public IFixedValueParameter<IntValue> NumberOfBitsParameter {
    49       get { return (IFixedValueParameter<IntValue>)Parameters[NumberOfBitsParameterName]; }
    50     }
     44    [Storable] public IFixedValueParameter<IntValue> NumberOfBitsParameter { get; private set; }
    5145    #endregion
    5246
     
    7064    private MultiplexerProblem(MultiplexerProblem original, Cloner cloner)
    7165      : base(original, cloner) {
     66      NumberOfBitsParameter = cloner.Clone(original.NumberOfBitsParameter);
    7267      RegisterEventHandlers();
    7368    }
     
    8176      : base(new SymbolicExpressionTreeEncoding()) {
    8277      Maximization = true;
    83       Parameters.Add(new FixedValueParameter<IntValue>(NumberOfBitsParameterName,
     78      Parameters.Add(NumberOfBitsParameter = new FixedValueParameter<IntValue>("NumberOfBits",
    8479        "The number of bits for the input parameter for the multiplexer function. This is the sum of the number of address bits and the number of input lines. E.g. the 11-MUX has 3 address bits and 8 input lines",
    8580        new IntValue(11)));
Note: See TracChangeset for help on using the changeset viewer.