Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5494


Ignore:
Timestamp:
02/16/11 15:00:11 (14 years ago)
Author:
mkommend
Message:

#1418 - Refactored Encodings.SymbolicExpressionTree

Location:
branches/DataAnalysis Refactoring
Files:
4 added
12 edited
6 moved

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj

    r5477 r5494  
    127127    <Compile Include="Crossovers\SymbolicExpressionTreeCrossover.cs" />
    128128    <Compile Include="Formatters\SymbolicExpressionTreeStringFormatter.cs" />
    129     <Compile Include="Interfaces\ISymbolicExpressionTreeAnalyzer.cs" />
    130     <Compile Include="Interfaces\ISymbolicExpressionTreeArchitectureManipulator.cs" />
    131     <Compile Include="Interfaces\ISymbolicExpressionTreeCreator.cs" />
    132     <Compile Include="Interfaces\ISymbolicExpressionTreeCrossover.cs" />
     129    <Compile Include="Interfaces\ISymbol.cs" />
     130    <Compile Include="Interfaces\ISymbolicExpressionTree.cs" />
     131    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeAnalyzer.cs" />
     132    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeArchitectureManipulator.cs" />
     133    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeCreator.cs" />
     134    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeCrossover.cs" />
    133135    <Compile Include="Interfaces\ISymbolicExpressionTreeNode.cs" />
    134136    <Compile Include="Interfaces\ISymbolicExpressionTreeStringFormatter.cs" />
     137    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeSizeConstraintOperator.cs" />
    135138    <Compile Include="Manipulators\ChangeNodeTypeManipulation.cs" />
    136     <Compile Include="Interfaces\ISymbolicExpressionTreeManipulator.cs" />
     139    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeManipulator.cs" />
    137140    <Compile Include="Manipulators\ReplaceBranchManipulation.cs" />
    138141    <Compile Include="Manipulators\FullTreeShaker.cs" />
     
    155158    <Compile Include="Creators\ProbabilisticTreeCreator.cs" />
    156159    <Compile Include="HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs" />
    157     <Compile Include="Interfaces\ISymbolicExpressionTreeOperator.cs" />
     160    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeOperator.cs" />
    158161    <Compile Include="SymbolicExpressionTree.cs" />
    159162    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs

    r5445 r5494  
    2222using System.Collections.Generic;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
    2524
    2625namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    2726  public interface ISymbolicExpressionGrammar : IItem {
    28     Symbol StartSymbol { get; }
    29     void AddSymbol(Symbol symbol);
    30     void RemoveSymbol(Symbol symbol);
    31     IEnumerable<Symbol> Symbols { get; }
    32     bool ContainsSymbol(Symbol symbol);
    33     void SetAllowedChild(Symbol parent, Symbol child, int argumentIndex);
    34     bool IsAllowedChild(Symbol parent, Symbol child, int argumentIndex);
    35     int GetMinExpressionLength(Symbol start);
    36     int GetMaxExpressionLength(Symbol start);
    37     int GetMinExpressionDepth(Symbol start);
    38     int GetMinSubtreeCount(Symbol symbol);
    39     void SetMinSubtreeCount(Symbol symbol, int value);
    40     int GetMaxSubtreeCount(Symbol symbol);
    41     void SetMaxSubtreeCount(Symbol symbol, int value);
     27    ISymbol StartSymbol { get; }
     28    void AddSymbol(ISymbol symbol);
     29    void RemoveSymbol(ISymbol symbol);
     30    IEnumerable<ISymbol> ISymbol { get; }
     31    bool ContainsSymbol(ISymbol symbol);
     32    void SetAllowedChild(ISymbol parent, ISymbol child, int argumentIndex);
     33    bool IsAllowedChild(ISymbol parent, ISymbol child, int argumentIndex);
     34    int GetMinExpressionLength(ISymbol start);
     35    int GetMaxExpressionLength(ISymbol start);
     36    int GetMinExpressionDepth(ISymbol start);
     37    int GetMinSubtreeCount(ISymbol symbol);
     38    void SetMinSubtreeCount(ISymbol symbol, int value);
     39    int GetMaxSubtreeCount(ISymbol symbol);
     40    void SetMaxSubtreeCount(ISymbol symbol, int value);
    4241  }
    4342}
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs

    r5445 r5494  
    2121using System.Collections.Generic;
    2222using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
    2423namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    25   public interface ISymbolicExpressionTreeNode {
     24  public interface ISymbolicExpressionTreeNode : IItem {
    2625    ISymbolicExpressionGrammar Grammar { get; }
    2726
    28     Symbol Symbol { get; }
     27    ISymbol Symbol { get; }
    2928    bool HasLocalParameters { get; }
    30     IEnumerable<Symbol> GetAllowedSymbols(int argumentIndex);
     29    IEnumerable<ISymbol> GetAllowedSymbols(int argumentIndex);
    3130
    3231    int GetHeight();
     
    3534    int GetMaxSubtreeCount();
    3635
    37     IEnumerable<SymbolicExpressionTreeNode> IterateNodesPostfix();
    38     IEnumerable<SymbolicExpressionTreeNode> IterateNodesPrefix();
     36    IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPostfix();
     37    IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix();
    3938
    40     IList<SymbolicExpressionTreeNode> SubTrees { get; }
    41     void AddSubTree(SymbolicExpressionTreeNode tree);
    42     void InsertSubTree(int index, SymbolicExpressionTreeNode tree);
     39    IEnumerable<SymbolicExpressionTreeNode> SubTrees { get; }
     40    void AddSubTree(ISymbolicExpressionTreeNode tree);
     41    void InsertSubTree(int index, ISymbolicExpressionTreeNode tree);
    4342    void RemoveSubTree(int index);
    4443
    4544    void ResetLocalParameters(IRandom random);
    4645    void ShakeLocalParameters(IRandom random, double shakingFactor);
    47 
    48 
    4946  }
    5047}
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeStringFormatter.cs

    r5445 r5494  
    2020#endregion
    2121
    22 using System;
    2322using HeuristicLab.Core;
    2423
    2524namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    26   public interface ISymbolicExpressionTreeStringFormatter: INamedItem {
    27     string Format(SymbolicExpressionTree symbolicExpressionTree);
     25  public interface ISymbolicExpressionTreeStringFormatter : INamedItem {
     26    string Format(ISymbolicExpressionTree symbolicExpressionTree);
    2827  }
    2928}
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeAnalyzer.cs

    r5483 r5494  
    2020#endregion
    2121
     22using HeuristicLab.Core;
    2223using HeuristicLab.Optimization;
    23 using HeuristicLab.Parameters;
    2424
    25 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
     25namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    2626  /// <summary>
    2727  /// Interface for analyzers that can be applied to symbolic expression trees.
    2828  /// </summary>
    2929  public interface ISymbolicExpressionTreeAnalyzer : IAnalyzer {
    30     ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
     30    IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
    3131  }
    3232}
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeArchitectureManipulator.cs

    r5483 r5494  
    2323using HeuristicLab.Data;
    2424
    25 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
     25namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    2626  /// <summary>
    2727  /// Interface for operators that manipulate symbolic expression trees.
     
    3030    IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter { get; }
    3131    IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter { get; }
    32 
    33     void ModifyArchitecture(
    34       IRandom random,
    35       SymbolicExpressionTree symbolicExpressionTree,
    36       ISymbolicExpressionGrammar grammar,
    37       IntValue maxTreeSize, IntValue maxTreeHeight,
    38       IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
    39       out bool success);
    4032  }
    4133}
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeCreator.cs

    r5483 r5494  
    2121
    2222using HeuristicLab.Core;
    23 using HeuristicLab.Data;
    2423using HeuristicLab.Optimization;
    2524
    26 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
     25namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    2726  /// <summary>
    2827  /// Interface for operators that create symbolic expression trees.
    2928  /// </summary>
    3029  public interface ISymbolicExpressionTreeCreator : ISymbolicExpressionTreeOperator, ISolutionCreator {
    31     ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
    32     IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter { get; }
    33     IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter { get; }
     30    ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
    3431  }
    3532}
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeCrossover.cs

    r5483 r5494  
    2323using HeuristicLab.Optimization;
    2424
    25 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
     25namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    2626  /// <summary>
    2727  /// Interface for crossover operators that can be applied to symbolic expression trees.
    2828  /// </summary>
    2929  public interface ISymbolicExpressionTreeCrossover : ISymbolicExpressionTreeOperator, ICrossover {
    30     ILookupParameter<ItemArray<SymbolicExpressionTree>> ParentsParameter { get; }
    31     ILookupParameter<SymbolicExpressionTree> ChildParameter { get; }
     30    ILookupParameter<ItemArray<ISymbolicExpressionTree>> ParentsParameter { get; }
     31    ILookupParameter<ISymbolicExpressionTree> ChildParameter { get; }
    3232  }
    3333}
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeManipulator.cs

    r5483 r5494  
    2323using HeuristicLab.Optimization;
    2424
    25 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
     25namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    2626  /// <summary>
    2727  /// Interface for operators that manipulate symbolic expression trees.
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeOperator.cs

    r5483 r5494  
    2121
    2222using HeuristicLab.Core;
    23 using HeuristicLab.Data;
    2423
    25 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
     24namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    2625  /// <summary>
    2726  /// Interface for operators that can be applied to symbolic expression trees.
    2827  /// </summary>
    2928  public interface ISymbolicExpressionTreeOperator : IOperator {
    30     IValueLookupParameter<IntValue> MaxTreeSizeParameter { get; }
    31     IValueLookupParameter<IntValue> MaxTreeHeightParameter { get; }
    32     ILookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionGrammarParameter { get; }
    3329  }
    3430}
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs

    r5445 r5494  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Data;
    25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
    2625using HeuristicLab.Parameters;
    2726using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2827
    29 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators {
     28namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    3029  /// <summary>
    3130  /// A base class for operators that manipulate real-valued vectors.
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Classification/3.4/Interfaces/IClassificationModel.cs

    r5487 r5494  
    2323namespace HeuristicLab.Problems.DataAnalysis.Classification {
    2424  public interface IClassificationModel : IDataAnalysisModel {
    25     IEnumerable<double> GetEstimatedValues(IClassificationProblemData problemData, int start, int end);
    26     IEnumerable<double> GetEstimatedClassValues(IClassificationProblemData problemData, int start, int end);
     25    IEnumerable<double> GetEstimatedValues(IClassificationProblemData problemData, IEnumerable<int> rows);
     26    IEnumerable<string> GetEstimatedClassValues(IClassificationProblemData problemData, IEnumerable<int> rows);
    2727  }
    2828}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Classification/3.4/Interfaces/IClassificationProblemData.cs

    r5487 r5494  
    2323namespace HeuristicLab.Problems.DataAnalysis.Classification {
    2424  public interface IClassificationProblemData : IDataAnalysisProblemData {
     25    string TargetVariable { get; }
    2526    int NumberOfClasses { get; }
     27
    2628    IEnumerable<string> ClassNames { get; }
    27     IEnumerable<double> SortedClassValues { get; }
     29    IEnumerable<double> ClassValues { get; }
     30
    2831    string GetClassName(double classValue);
    2932    double GetClassValue(string className);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Classification/3.4/Interfaces/IClassificationSolution.cs

    r5487 r5494  
    2323  public interface IClassificationSolution : IDataAnalysisSolution {
    2424    new IClassificationModel Model { get; }
    25     new IClassificationProblemData Problem { get; }
     25    new IClassificationProblemData ProblemData { get; }
    2626  }
    2727}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Regression/3.4/Interaces/IRegressionModel.cs

    r5488 r5494  
    2323namespace HeuristicLab.Problems.DataAnalysis.Regression {
    2424  public interface IRegressionModel : IDataAnalysisModel {
    25     IEnumerable<double> GetEstimatedValues(IRegressionProblemData problemData, int start, int end);
     25    IEnumerable<double> GetEstimatedValues(IRegressionProblemData problemData, IEnumerable<int> rows);
    2626  }
    2727}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Regression/3.4/Interaces/IRegressionProblemData.cs

    r5488 r5494  
    2222namespace HeuristicLab.Problems.DataAnalysis.Regression {
    2323  public interface IRegressionProblemData : IDataAnalysisProblemData {
     24    string TargetVariable { get; }
    2425  }
    2526}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r5474 r5494  
    209209    </BootstrapperPackage>
    210210  </ItemGroup>
    211   <ItemGroup />
     211  <ItemGroup>
     212    <Folder Include="Interfaces\" />
     213  </ItemGroup>
    212214  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    213215  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs

    r5486 r5494  
    2727    Dataset Dataset { get; }
    2828    IEnumerable<string> InputVariables { get; }
    29     string TargetVariable { get; }
    3029  }
    3130}
Note: See TracChangeset for help on using the changeset viewer.