Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/26/10 15:47:10 (15 years ago)
Author:
gkronber
Message:

Added interfaces for symbolic expression tree operators and added multi manipulation operators. #937 (Data types and operators for symbolic expression tree encoding)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/SymbolicExpressionTreeCreator.cs

    r3462 r3534  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
    3031
    3132namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators {
     
    3536  [Item("SymbolicExpressionTreeCreator", "A base class for operators creating symbolic expression trees.")]
    3637  [StorableClass]
    37   public abstract class SymbolicExpressionTreeCreator : SymbolicExpressionTreeOperator, ISolutionCreator {
     38  public abstract class SymbolicExpressionTreeCreator : SymbolicExpressionTreeOperator, ISymbolicExpressionTreeCreator {
    3839    private const string MaxFunctionDefinitionsParameterName = "MaxFunctionDefinitions";
    3940    private const string MaxFunctionArgumentsParameterName = "MaxFunctionArguments";
     41    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
    4042    #region Parameter Properties
    4143    public IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter {
     
    4446    public IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter {
    4547      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionArgumentsParameterName]; }
     48    }
     49    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
     50      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
    4651    }
    4752    #endregion
     
    5459      get { return MaxFunctionArgumentsParameter.ActualValue; }
    5560    }
     61    public SymbolicExpressionTree SymbolicExpressionTree {
     62      get { return SymbolicExpressionTreeParameter.ActualValue; }
     63      set { SymbolicExpressionTreeParameter.ActualValue = value; }
     64    }
    5665
    5766    #endregion
     
    6069      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionDefinitionsParameterName, "Maximal number of function definitions in the symbolic expression tree."));
    6170      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionArgumentsParameterName, "Maximal number of arguments of automatically defined functions in the symbolic expression tree."));
     71      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree that should be created."));
    6272    }
    6373
    6474    public sealed override IOperation Apply() {
    65       SymbolicExpressionTreeParameter.ActualValue = Create(Random, SymbolicExpressionGrammar,
     75      SymbolicExpressionTree = Create(Random, SymbolicExpressionGrammar,
    6676        MaxTreeSize, MaxTreeHeight, MaxFunctionDefinitions, MaxFunctionArguments);
    6777      return null;
Note: See TracChangeset for help on using the changeset viewer.