Changeset 5499 for branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthCalculator.cs
- Timestamp:
- 02/16/11 19:01:00 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Files:
-
- 1 edited
- 1 moved
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/Analyzers/SymbolicExpressionTreeLengthCalculator.cs
r5494 r5499 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding .Analyzers{29 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 30 30 /// <summary> 31 /// An operator that outputs the tree sizeof a symbolic expression tree.31 /// An operator that outputs the length of a symbolic expression tree. 32 32 /// </summary> 33 [Item("SymbolicExpressionTree SizeCalculator", "An operator that outputs the tree sizeof a symbolic expression tree.")]33 [Item("SymbolicExpressionTreeLengthCalculator", "An operator that outputs the length of a symbolic expression tree.")] 34 34 [StorableClass] 35 public sealed class SymbolicExpressionTree SizeCalculator : SingleSuccessorOperator {35 public sealed class SymbolicExpressionTreeLengthCalculator : SingleSuccessorOperator { 36 36 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; 37 private const string SymbolicExpressionTree SizeParameterName = "SymbolicExpressionTreeSize";37 private const string SymbolicExpressionTreeLengthParameterName = "SymbolicExpressionTreeLength"; 38 38 39 39 #region parameter properties … … 41 41 get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 42 42 } 43 public ILookupParameter<DoubleValue> SymbolicExpressionTree SizeParameter {44 get { return (ILookupParameter<DoubleValue>)Parameters[SymbolicExpressionTree SizeParameterName]; }43 public ILookupParameter<DoubleValue> SymbolicExpressionTreeLengthParameter { 44 get { return (ILookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeLengthParameterName]; } 45 45 } 46 46 #endregion … … 50 50 get { return SymbolicExpressionTreeParameter.ActualValue; } 51 51 } 52 public DoubleValue SymbolicExpressionTree Size{53 get { return SymbolicExpressionTree SizeParameter.ActualValue; }54 set { SymbolicExpressionTree SizeParameter.ActualValue = value; }52 public DoubleValue SymbolicExpressionTreeLength { 53 get { return SymbolicExpressionTreeLengthParameter.ActualValue; } 54 set { SymbolicExpressionTreeLengthParameter.ActualValue = value; } 55 55 } 56 56 #endregion 57 57 58 58 [StorableConstructor] 59 private SymbolicExpressionTree SizeCalculator(bool deserializing) : base(deserializing) { }60 private SymbolicExpressionTree SizeCalculator(SymbolicExpressionTreeSizeCalculator original, Cloner cloner) : base(original, cloner) { }61 public SymbolicExpressionTree SizeCalculator()59 private SymbolicExpressionTreeLengthCalculator(bool deserializing) : base(deserializing) { } 60 private SymbolicExpressionTreeLengthCalculator(SymbolicExpressionTreeLengthCalculator original, Cloner cloner) : base(original, cloner) { } 61 public SymbolicExpressionTreeLengthCalculator() 62 62 : base() { 63 Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose sizeshould be calculated."));64 Parameters.Add(new LookupParameter<DoubleValue>(SymbolicExpressionTree SizeParameterName, "The tree sizeof the symbolic expression tree."));63 Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose length should be calculated.")); 64 Parameters.Add(new LookupParameter<DoubleValue>(SymbolicExpressionTreeLengthParameterName, "The length of the symbolic expression tree.")); 65 65 } 66 66 67 67 public override IOperation Apply() { 68 SymbolicExpressionTree tree = SymbolicExpressionTree; 69 SymbolicExpressionTreeSize = new DoubleValue(tree.Size); 68 SymbolicExpressionTreeLength = new DoubleValue(SymbolicExpressionTree.Size); 70 69 return base.Apply(); 71 70 } 72 71 73 72 public override IDeepCloneable Clone(Cloner cloner) { 74 return new SymbolicExpressionTree SizeCalculator(this, cloner);73 return new SymbolicExpressionTreeLengthCalculator(this, cloner); 75 74 } 76 75 }
Note: See TracChangeset
for help on using the changeset viewer.