Changeset 5499 for branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs
- Timestamp:
- 02/16/11 19:01:00 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Property svn:ignore
-
old new 2 2 obj 3 3 HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs 4 *.user
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs
r5494 r5499 33 33 [StorableClass] 34 34 public abstract class SymbolicExpressionTreeManipulator : SymbolicExpressionTreeOperator, ISymbolicExpressionTreeManipulator { 35 private const string FailedManipulationEventsParameterName = "FailedManipulationEvents";36 35 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; 37 36 38 37 #region Parameter Properties 39 public IValueParameter<IntValue> FailedManipulationEventsParameter {40 get { return (IValueParameter<IntValue>)Parameters[FailedManipulationEventsParameterName]; }41 }42 38 public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { 43 39 get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } … … 46 42 47 43 #region Properties 48 public IntValue FailedManipulationEvents {49 get { return FailedManipulationEventsParameter.Value; }50 }51 44 public SymbolicExpressionTree SymbolicExpressionTree { 52 45 get { return SymbolicExpressionTreeParameter.ActualValue; } … … 59 52 public SymbolicExpressionTreeManipulator() 60 53 : base() { 61 Parameters.Add(new ValueParameter<IntValue>(FailedManipulationEventsParameterName, "The number of failed manipulation events.", new IntValue()));62 54 Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied.")); 63 55 } … … 65 57 public sealed override IOperation Apply() { 66 58 SymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue; 67 bool success; 68 Manipulate(RandomParameter.ActualValue, tree, SymbolicExpressionGrammarParameter.ActualValue, 69 MaxTreeSizeParameter.ActualValue, MaxTreeHeightParameter.ActualValue, out success); 59 Manipulate(RandomParameter.ActualValue, tree); 70 60 71 if (!success) FailedManipulationEvents.Value++;72 61 return base.Apply(); 73 62 } 74 63 75 protected abstract void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, 76 IntValue maxTreeSize, IntValue maxTreeHeight, out bool success); 64 protected abstract void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree); 77 65 } 78 66 }
Note: See TracChangeset
for help on using the changeset viewer.