Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/10 21:10:46 (15 years ago)
Author:
gkronber
Message:

Implemented reviewer comments. #893 (HeuristicLab 3.3.0 application review)

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  
    3333using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
    3434using System;
     35using HeuristicLab.Optimization.Operators;
    3536
    3637namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers {
     
    4344    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
    4445    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";
    4650    private const string ResultsParameterName = "Results";
    4751
     
    5963      get { return (ValueLookupParameter<VariableCollection>)Parameters[ResultsParameterName]; }
    6064    }
    61    
     65
    6266    [Storable]
    6367    private MinAverageMaxValueAnalyzer valueAnalyzer;
    6468    [Storable]
    65     private SymbolicExpressionTreeSizeCalculator sizeCalculator;
     69    private UniformSubScopesProcessor subScopesProcessor;
    6670
    6771    #endregion
     
    7377      Parameters.Add(new ValueLookupParameter<VariableCollection>(ResultsParameterName, "The results collection where the analysis values should be stored."));
    7478
    75       sizeCalculator = new SymbolicExpressionTreeSizeCalculator();
     79      subScopesProcessor = new UniformSubScopesProcessor();
     80      SymbolicExpressionTreeSizeCalculator sizeCalculator = new SymbolicExpressionTreeSizeCalculator();
    7681      valueAnalyzer = new MinAverageMaxValueAnalyzer();
     82
     83      subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
    7784      sizeCalculator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
    78       sizeCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;
    7985      sizeCalculator.SymbolicExpressionTreeSizeParameter.ActualName = SymbolicExpressionTreeSizeParameter.Name;
    80       sizeCalculator.SymbolicExpressionTreeSizeParameter.Depth = SymbolicExpressionTreeSizeParameter.Depth;
    8186      valueAnalyzer.ValueParameter.ActualName = sizeCalculator.SymbolicExpressionTreeSizeParameter.Name;
    8287      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);
    8394      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";
    8895
    89       OperatorGraph.InitialOperator = sizeCalculator;
    90       sizeCalculator.Successor = valueAnalyzer;
     96      OperatorGraph.InitialOperator = subScopesProcessor;
     97      subScopesProcessor.Operator = sizeCalculator;
     98      sizeCalculator.Successor = null;
     99      subScopesProcessor.Successor = valueAnalyzer;
    91100      valueAnalyzer.Successor = null;
    92101
     
    119128    private void OnDepthParameterChanged() {
    120129      valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeParameter.Depth;
    121       sizeCalculator.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;
    122       sizeCalculator.SymbolicExpressionTreeSizeParameter.Depth = SymbolicExpressionTreeSizeParameter.Depth;
     130      subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
    123131    }
    124132  }
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/SymbolicExpressionTreeSizeCalculator.cs

    r3683 r3710  
    4242
    4343    #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]; }
    4646    }
    47     public ScopeTreeLookupParameter<DoubleValue> SymbolicExpressionTreeSizeParameter {
    48       get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeSizeParameterName]; }
     47    public ILookupParameter<DoubleValue> SymbolicExpressionTreeSizeParameter {
     48      get { return (ILookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeSizeParameterName]; }
    4949    }
    5050    #endregion
    5151
    5252    #region properties
    53     public ItemArray<SymbolicExpressionTree> SymbolicExpressionTree {
     53    public SymbolicExpressionTree SymbolicExpressionTree {
    5454      get { return SymbolicExpressionTreeParameter.ActualValue; }
    5555    }
    56     public ItemArray<DoubleValue> SymbolicExpressionTreeSize {
     56    public DoubleValue SymbolicExpressionTreeSize {
    5757      get { return SymbolicExpressionTreeSizeParameter.ActualValue; }
    5858      set { SymbolicExpressionTreeSizeParameter.ActualValue = value; }
     
    6262    public SymbolicExpressionTreeSizeCalculator()
    6363      : 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."));
    6666    }
    6767
    6868    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);
    7271      return base.Apply();
    7372    }
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj

    r3681 r3710  
    150150      <Name>HeuristicLab.Collections-3.3</Name>
    151151    </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>
    152156    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    153157      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
     
    165169      <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    166170      <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>
    167175    </ProjectReference>
    168176    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs.frame

    r3651 r3710  
    3131  [PluginDependency("HeuristicLab.Collections", "3.3.0.0")]
    3232  [PluginDependency("HeuristicLab.Common", "3.3.0.0")]
     33  [PluginDependency("HeuristicLab.Common.Resources", "3.3.0.0")]
    3334  [PluginDependency("HeuristicLab.Core", "3.3.0.0")]
    3435  [PluginDependency("HeuristicLab.Data", "3.3.0.0")]
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTree.cs

    r3442 r3710  
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3030using HeuristicLab.Data;
     31using System.Drawing;
    3132
    3233namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
     
    3435  [Item("SymbolicExpressionTree", "Represents a symbolic expression tree.")]
    3536  public class SymbolicExpressionTree : Item {
     37    public override Image ItemImage {
     38      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Function; }
     39    }
    3640    [Storable]
    3741    private SymbolicExpressionTreeNode root;
Note: See TracChangeset for help on using the changeset viewer.