- Timestamp:
- 11/17/11 11:51:09 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs
r6944 r7012 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.PluginInfrastructure; 29 30 30 31 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 32 [NonDiscoverableType] 31 33 [StorableClass] 32 34 [Item("FullTreeCreator", "An operator that creates new symbolic expression trees using the 'Full' method")] … … 60 62 public IntValue MaximumSymbolicExpressionTreeDepth { 61 63 get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; } 64 } 65 66 public IntValue MaximumSymbolicExpressionTreeLength { 67 get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; } 62 68 } 63 69 … … 97 103 98 104 protected override ISymbolicExpressionTree Create(IRandom random) { 99 return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeDepth.Value); 105 return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value); 106 } 107 108 public override ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) { 109 return Create(random, grammar, maxTreeLength, maxTreeDepth); 100 110 } 101 111 … … 108 118 /// <param name="grammar">Available tree grammar</param> 109 119 /// <param name="maxTreeDepth">Maximum tree depth</param> 120 /// <param name="maxTreeLength">Maximum tree length. This parameter is not used.</param> 110 121 /// <returns></returns> 111 public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTree Depth) {122 public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) { 112 123 var tree = new SymbolicExpressionTree(); 113 124 var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode(); -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/GrowTreeCreator.cs
r6944 r7012 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.PluginInfrastructure; 29 30 30 31 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 32 [NonDiscoverableType] 31 33 [StorableClass] 32 34 [Item("GrowTreeCreator", "An operator that creates new symbolic expression trees using the 'Grow' method")] … … 60 62 public IntValue MaximumSymbolicExpressionTreeDepth { 61 63 get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; } 64 } 65 66 public IntValue MaximumSymbolicExpressionTreeLength { 67 get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; } 62 68 } 63 69 … … 97 103 98 104 protected override ISymbolicExpressionTree Create(IRandom random) { 99 return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeDepth.Value); 105 return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value); 106 } 107 108 public override ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) { 109 return Create(random, grammar, maxTreeLength, maxTreeDepth); 100 110 } 101 111 … … 107 117 /// <param name="grammar">Available tree grammar</param> 108 118 /// <param name="maxTreeDepth">Maximum tree depth</param> 119 /// <param name="maxTreeLength">Maximum tree length. This parameter is not used.</param> 109 120 /// <returns></returns> 110 public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTree Depth) {121 public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) { 111 122 var tree = new SymbolicExpressionTree(); 112 123 var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode(); -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs
r6911 r7012 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.PluginInfrastructure; 30 31 31 32 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 33 [NonDiscoverableType] 32 34 [StorableClass] 33 35 [Item("ProbabilisticTreeCreator", "An operator that creates new symbolic expression trees with uniformly distributed length")] … … 101 103 } 102 104 103 public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, 104 int maxTreeLength, int maxTreeDepth) { 105 public override ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) { 106 return Create(random, grammar, maxTreeLength, maxTreeDepth); 107 } 108 109 public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) { 105 110 SymbolicExpressionTree tree = new SymbolicExpressionTree(); 106 111 var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode(); -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/RampedHalfAndHalfTreeCreator.cs
r6887 r7012 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.PluginInfrastructure; 31 32 32 33 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 34 [NonDiscoverableType] 33 35 [StorableClass] 34 36 [Item("RampedHalfAndHalfTreeCreator", "An operator that creates new symbolic expression trees in an alternate way: half the trees are created usign the 'Grow' method while the other half are created using the 'Full' method")] … … 72 74 } 73 75 76 public IntValue MaximumSymbolicExpressionTreeLength { 77 get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; } 78 } 79 74 80 public ISymbolicExpressionGrammar SymbolicExpressionTreeGrammar { 75 81 get { return ClonedSymbolicExpressionTreeGrammarParameter.ActualValue; } … … 106 112 107 113 protected override ISymbolicExpressionTree Create(IRandom random) { 108 return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeDepth.Value); 114 return Create(random, SymbolicExpressionTreeGrammar, MaximumSymbolicExpressionTreeDepth.Value, MaximumSymbolicExpressionTreeLength.Value); 115 } 116 117 public override ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) { 118 return Create(random, grammar, maxTreeLength, maxTreeDepth); 109 119 } 110 120 … … 117 127 /// <param name="maxTreeDepth">Maximum tree depth</param> 118 128 /// <returns></returns> 119 public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTree Depth) {129 public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) { 120 130 var tree = new SymbolicExpressionTree(); 121 131 var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode(); -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs
r6233 r7012 39 39 #endregion 40 40 41 #region Prope ties41 #region Properties 42 42 public ISymbolicExpressionTree SymbolicExpressionTree { 43 43 get { return SymbolicExpressionTreeParameter.ActualValue; } … … 60 60 61 61 protected abstract ISymbolicExpressionTree Create(IRandom random); 62 public abstract ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth); 62 63 } 63 64 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeCreator.cs
r5809 r7012 29 29 public interface ISymbolicExpressionTreeCreator : ISymbolicExpressionTreeOperator, ISolutionCreator { 30 30 ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { get; } 31 ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth); 31 32 } 32 33 }
Note: See TracChangeset
for help on using the changeset viewer.