- Timestamp:
- 05/06/10 19:02:45 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3
- Files:
-
- 3 deleted
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/MinAvgMaxSymbolicExpressionTreeSizeAnalyzer.cs
r3665 r3681 32 32 using HeuristicLab.Analysis; 33 33 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces; 34 using System; 34 35 35 36 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers { 36 37 /// <summary> 37 /// An operator that tracks the min avgerage and max tree size in the population.38 /// An operator that tracks the min avgerage and max tree size. 38 39 /// </summary> 39 [Item(" PopulationMinAvgMaxTreeSizeAnalyzer", "An operator that tracks the min avgerage and max tree size in the population.")]40 [Item("MinAvgMaxSymbolicExpressionTreeSizeAnalyzer", "An operator that tracks the min avgerage and max tree size.")] 40 41 [StorableClass] 41 public sealed class PopulationMinAvgMaxTreeSizeAnalyzer : AlgorithmOperator, ISymbolicExpressionTreePopulationAnalyzer {42 public sealed class MinAvgMaxSymbolicExpressionTreeSizeAnalyzer : AlgorithmOperator, ISymbolicExpressionTreeAnalyzer { 42 43 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; 43 44 private const string SymbolicExpressionTreeSizeParameterName = "SymbolicExpressionTreeSize"; … … 45 46 private const string ResultsParameterName = "Results"; 46 47 47 48 48 #region parameter properties 49 public ILookupParameter<ItemArray<SymbolicExpressionTree>> SymbolicExpressionTreeParameter {50 get { return ( ILookupParameter<ItemArray<SymbolicExpressionTree>>)Parameters[SymbolicExpressionTreeParameterName]; }49 public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { 50 get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 51 51 } 52 public ILookupParameter<ItemArray<DoubleValue>> SymbolicExpressionTreeSizeParameter {53 get { return ( ILookupParameter<ItemArray<DoubleValue>>)Parameters[SymbolicExpressionTreeSizeParameterName]; }52 public ScopeTreeLookupParameter<DoubleValue> SymbolicExpressionTreeSizeParameter { 53 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeSizeParameterName]; } 54 54 } 55 55 public ValueLookupParameter<DataTable> SymbolicExpressionTreeSizesParameter { … … 59 59 get { return (ValueLookupParameter<VariableCollection>)Parameters[ResultsParameterName]; } 60 60 } 61 62 [Storable] 63 private MinAverageMaxValueAnalyzer valueAnalyzer; 64 61 65 #endregion 62 public PopulationMinAvgMaxTreeSizeAnalyzer()66 public MinAvgMaxSymbolicExpressionTreeSizeAnalyzer() 63 67 : base() { 64 68 Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose size should be calculated.")); … … 69 73 UniformSubScopesProcessor subScopesProcessor = new UniformSubScopesProcessor(); 70 74 SymbolicExpressionTreeSizeCalculator sizeCalculator = new SymbolicExpressionTreeSizeCalculator(); 71 MinAverageMaxValueAnalyzer valuesAnalyzer = new MinAverageMaxValueAnalyzer();75 valueAnalyzer = new MinAverageMaxValueAnalyzer(); 72 76 sizeCalculator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name; 73 77 sizeCalculator.SymbolicExpressionTreeSizeParameter.ActualName = SymbolicExpressionTreeSizeParameter.Name; 74 valuesAnalyzer.ValueParameter.ActualName = sizeCalculator.SymbolicExpressionTreeSizeParameter.Name; 75 valuesAnalyzer.ValuesParameter.ActualName = SymbolicExpressionTreeSizesParameter.Name; 76 valuesAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name; 77 valuesAnalyzer.AverageValueParameter.ActualName = "Avg. Tree Size"; 78 valuesAnalyzer.MaxValueParameter.ActualName = "Max Tree Size"; 79 valuesAnalyzer.MinValueParameter.ActualName = "Min Tree Size"; 78 valueAnalyzer.ValueParameter.ActualName = sizeCalculator.SymbolicExpressionTreeSizeParameter.Name; 79 valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeSizeParameter.Depth; 80 valueAnalyzer.ValuesParameter.ActualName = SymbolicExpressionTreeSizesParameter.Name; 81 valueAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name; 82 valueAnalyzer.AverageValueParameter.ActualName = "Avg. Tree Size"; 83 valueAnalyzer.MaxValueParameter.ActualName = "Max Tree Size"; 84 valueAnalyzer.MinValueParameter.ActualName = "Min Tree Size"; 80 85 81 86 OperatorGraph.InitialOperator = subScopesProcessor; 82 87 subScopesProcessor.Operator = sizeCalculator; 83 subScopesProcessor.Successor = valuesAnalyzer; 84 valuesAnalyzer.Successor = null; 88 subScopesProcessor.Successor = valueAnalyzer; 89 valueAnalyzer.Successor = null; 90 91 Initialize(); 92 } 93 94 [StorableConstructor] 95 private MinAvgMaxSymbolicExpressionTreeSizeAnalyzer(bool deserializing) : base() { } 96 97 [StorableHook(HookType.AfterDeserialization)] 98 private void Initialize() { 99 SymbolicExpressionTreeParameter.DepthChanged += new EventHandler(SymbolicExpressionTreeParameter_DepthChanged); 100 } 101 102 public override IDeepCloneable Clone(Cloner cloner) { 103 MinAvgMaxSymbolicExpressionTreeSizeAnalyzer clone = (MinAvgMaxSymbolicExpressionTreeSizeAnalyzer)base.Clone(cloner); 104 clone.Initialize(); 105 return clone; 106 } 107 108 private void SymbolicExpressionTreeParameter_DepthChanged(object sender, EventArgs e) { 109 valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeParameter.Depth; 85 110 } 86 111 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj
r3651 r3681 83 83 </ItemGroup> 84 84 <ItemGroup> 85 <Compile Include="Analyzers\PopulationMinAvgMaxTreeSizeAnalyzer.cs" /> 86 <Compile Include="Analyzers\SymbolicExpressionTreeSizeAnalyzer.cs" /> 85 <Compile Include="Analyzers\MinAvgMaxSymbolicExpressionTreeSizeAnalyzer.cs" /> 87 86 <Compile Include="Analyzers\SymbolicExpressionTreeSizeCalculator.cs" /> 88 87 <Compile Include="ArchitectureManipulators\ArgumentCreater.cs" /> … … 103 102 <Compile Include="Interfaces\ISymbolicExpressionTreeCreator.cs" /> 104 103 <Compile Include="Interfaces\ISymbolicExpressionTreeCrossover.cs" /> 105 <Compile Include="Interfaces\ISymbolicExpressionTreeMultiPopulationAnalyzer.cs" />106 <Compile Include="Interfaces\ISymbolicExpressionTreePopulationAnalyzer.cs" />107 104 <Compile Include="Manipulators\ChangeNodeTypeManipulation.cs" /> 108 105 <Compile Include="Interfaces\ISymbolicExpressionTreeManipulator.cs" /> -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeAnalyzer.cs
r3658 r3681 35 35 /// </summary> 36 36 public interface ISymbolicExpressionTreeAnalyzer : IAnalyzer { 37 ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }37 ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; } 38 38 } 39 39 }
Note: See TracChangeset
for help on using the changeset viewer.