- Timestamp:
- 05/07/10 21:10:46 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/MinAvgMaxSymbolicExpressionTreeSizeAnalyzer.cs
r3683 r3710 33 33 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces; 34 34 using System; 35 using HeuristicLab.Optimization.Operators; 35 36 36 37 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers { … … 43 44 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; 44 45 private const string SymbolicExpressionTreeSizeParameterName = "SymbolicExpressionTreeSize"; 45 private const string SymbolicExpressionTreeSizesParameterName = "SymbolicExpressionTreeSizes"; 46 private const string SymbolicExpressionTreeSizesParameterName = "Symbolic expression tree size"; 47 private const string MinTreeSizeParameterName = "Min tree size"; 48 private const string AverageTreeSizeParameterName = "Average tree size"; 49 private const string MaxTreeSizeParameterName = "Max tree size"; 46 50 private const string ResultsParameterName = "Results"; 47 51 … … 59 63 get { return (ValueLookupParameter<VariableCollection>)Parameters[ResultsParameterName]; } 60 64 } 61 65 62 66 [Storable] 63 67 private MinAverageMaxValueAnalyzer valueAnalyzer; 64 68 [Storable] 65 private SymbolicExpressionTreeSizeCalculator sizeCalculator;69 private UniformSubScopesProcessor subScopesProcessor; 66 70 67 71 #endregion … … 73 77 Parameters.Add(new ValueLookupParameter<VariableCollection>(ResultsParameterName, "The results collection where the analysis values should be stored.")); 74 78 75 sizeCalculator = new SymbolicExpressionTreeSizeCalculator(); 79 subScopesProcessor = new UniformSubScopesProcessor(); 80 SymbolicExpressionTreeSizeCalculator sizeCalculator = new SymbolicExpressionTreeSizeCalculator(); 76 81 valueAnalyzer = new MinAverageMaxValueAnalyzer(); 82 83 subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth; 77 84 sizeCalculator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name; 78 sizeCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;79 85 sizeCalculator.SymbolicExpressionTreeSizeParameter.ActualName = SymbolicExpressionTreeSizeParameter.Name; 80 sizeCalculator.SymbolicExpressionTreeSizeParameter.Depth = SymbolicExpressionTreeSizeParameter.Depth;81 86 valueAnalyzer.ValueParameter.ActualName = sizeCalculator.SymbolicExpressionTreeSizeParameter.Name; 82 87 valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeSizeParameter.Depth; 88 valueAnalyzer.AverageValueParameter.ActualName = AverageTreeSizeParameterName; 89 valueAnalyzer.CollectAverageValueInResultsParameter.Value = new BoolValue(false); 90 valueAnalyzer.MaxValueParameter.ActualName = MaxTreeSizeParameterName; 91 valueAnalyzer.CollectMaxValueInResultsParameter.Value = new BoolValue(false); 92 valueAnalyzer.MinValueParameter.ActualName = MinTreeSizeParameterName; 93 valueAnalyzer.CollectMinValueInResultsParameter.Value = new BoolValue(false); 83 94 valueAnalyzer.ValuesParameter.ActualName = SymbolicExpressionTreeSizesParameter.Name; 84 valueAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name;85 valueAnalyzer.AverageValueParameter.ActualName = "Avg. Tree Size";86 valueAnalyzer.MaxValueParameter.ActualName = "Max Tree Size";87 valueAnalyzer.MinValueParameter.ActualName = "Min Tree Size";88 95 89 OperatorGraph.InitialOperator = sizeCalculator; 90 sizeCalculator.Successor = valueAnalyzer; 96 OperatorGraph.InitialOperator = subScopesProcessor; 97 subScopesProcessor.Operator = sizeCalculator; 98 sizeCalculator.Successor = null; 99 subScopesProcessor.Successor = valueAnalyzer; 91 100 valueAnalyzer.Successor = null; 92 101 … … 119 128 private void OnDepthParameterChanged() { 120 129 valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeParameter.Depth; 121 sizeCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth; 122 sizeCalculator.SymbolicExpressionTreeSizeParameter.Depth = SymbolicExpressionTreeSizeParameter.Depth; 130 subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth; 123 131 } 124 132 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/SymbolicExpressionTreeSizeCalculator.cs
r3683 r3710 42 42 43 43 #region parameter properties 44 public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {45 get { return ( ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }44 public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { 45 get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 46 46 } 47 public ScopeTreeLookupParameter<DoubleValue> SymbolicExpressionTreeSizeParameter {48 get { return ( ScopeTreeLookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeSizeParameterName]; }47 public ILookupParameter<DoubleValue> SymbolicExpressionTreeSizeParameter { 48 get { return (ILookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeSizeParameterName]; } 49 49 } 50 50 #endregion 51 51 52 52 #region properties 53 public ItemArray<SymbolicExpressionTree>SymbolicExpressionTree {53 public SymbolicExpressionTree SymbolicExpressionTree { 54 54 get { return SymbolicExpressionTreeParameter.ActualValue; } 55 55 } 56 public ItemArray<DoubleValue>SymbolicExpressionTreeSize {56 public DoubleValue SymbolicExpressionTreeSize { 57 57 get { return SymbolicExpressionTreeSizeParameter.ActualValue; } 58 58 set { SymbolicExpressionTreeSizeParameter.ActualValue = value; } … … 62 62 public SymbolicExpressionTreeSizeCalculator() 63 63 : base() { 64 Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose size should be calculated."));65 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(SymbolicExpressionTreeSizeParameterName, "The tree size of the symbolic expression tree."));64 Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose size should be calculated.")); 65 Parameters.Add(new LookupParameter<DoubleValue>(SymbolicExpressionTreeSizeParameterName, "The tree size of the symbolic expression tree.")); 66 66 } 67 67 68 68 public override IOperation Apply() { 69 ItemArray<SymbolicExpressionTree> trees = SymbolicExpressionTree; 70 SymbolicExpressionTreeSize = new ItemArray<DoubleValue>(from tree in trees 71 select new DoubleValue(tree.Size)); 69 SymbolicExpressionTree tree = SymbolicExpressionTree; 70 SymbolicExpressionTreeSize = new DoubleValue(tree.Size); 72 71 return base.Apply(); 73 72 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj
r3681 r3710 150 150 <Name>HeuristicLab.Collections-3.3</Name> 151 151 </ProjectReference> 152 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj"> 153 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project> 154 <Name>HeuristicLab.Common.Resources-3.3</Name> 155 </ProjectReference> 152 156 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 153 157 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project> … … 165 169 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project> 166 170 <Name>HeuristicLab.Operators-3.3</Name> 171 </ProjectReference> 172 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj"> 173 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project> 174 <Name>HeuristicLab.Optimization.Operators-3.3</Name> 167 175 </ProjectReference> 168 176 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs.frame
r3651 r3710 31 31 [PluginDependency("HeuristicLab.Collections", "3.3.0.0")] 32 32 [PluginDependency("HeuristicLab.Common", "3.3.0.0")] 33 [PluginDependency("HeuristicLab.Common.Resources", "3.3.0.0")] 33 34 [PluginDependency("HeuristicLab.Core", "3.3.0.0")] 34 35 [PluginDependency("HeuristicLab.Data", "3.3.0.0")] -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTree.cs
r3442 r3710 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 using HeuristicLab.Data; 31 using System.Drawing; 31 32 32 33 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { … … 34 35 [Item("SymbolicExpressionTree", "Represents a symbolic expression tree.")] 35 36 public class SymbolicExpressionTree : Item { 37 public override Image ItemImage { 38 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Function; } 39 } 36 40 [Storable] 37 41 private SymbolicExpressionTreeNode root;
Note: See TracChangeset
for help on using the changeset viewer.