- Timestamp:
- 04/26/10 15:47:10 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/SymbolicExpressionTreeCreator.cs
r3462 r3534 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces; 30 31 31 32 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators { … … 35 36 [Item("SymbolicExpressionTreeCreator", "A base class for operators creating symbolic expression trees.")] 36 37 [StorableClass] 37 public abstract class SymbolicExpressionTreeCreator : SymbolicExpressionTreeOperator, IS olutionCreator {38 public abstract class SymbolicExpressionTreeCreator : SymbolicExpressionTreeOperator, ISymbolicExpressionTreeCreator { 38 39 private const string MaxFunctionDefinitionsParameterName = "MaxFunctionDefinitions"; 39 40 private const string MaxFunctionArgumentsParameterName = "MaxFunctionArguments"; 41 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; 40 42 #region Parameter Properties 41 43 public IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter { … … 44 46 public IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter { 45 47 get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionArgumentsParameterName]; } 48 } 49 public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { 50 get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 46 51 } 47 52 #endregion … … 54 59 get { return MaxFunctionArgumentsParameter.ActualValue; } 55 60 } 61 public SymbolicExpressionTree SymbolicExpressionTree { 62 get { return SymbolicExpressionTreeParameter.ActualValue; } 63 set { SymbolicExpressionTreeParameter.ActualValue = value; } 64 } 56 65 57 66 #endregion … … 60 69 Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionDefinitionsParameterName, "Maximal number of function definitions in the symbolic expression tree.")); 61 70 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.")); 62 72 } 63 73 64 74 public sealed override IOperation Apply() { 65 SymbolicExpressionTree Parameter.ActualValue= Create(Random, SymbolicExpressionGrammar,75 SymbolicExpressionTree = Create(Random, SymbolicExpressionGrammar, 66 76 MaxTreeSize, MaxTreeHeight, MaxFunctionDefinitions, MaxFunctionArguments); 67 77 return null;
Note: See TracChangeset
for help on using the changeset viewer.