Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/17/11 14:07:47 (14 years ago)
Author:
mkommend
Message:

#1418: Corrected problem interfaces & unified naming of subtrees.

Location:
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj

    r5729 r5733  
    111111    <Compile Include="SymbolicRegressionModel.cs" />
    112112    <Compile Include="Interfaces\ISymbolicRegressionModel.cs" />
    113     <Compile Include="Interfaces\ISymbolicRegressionProblem.cs" />
    114     <Compile Include="Interfaces\ISymbolicRegressionSingleObjectiveProblem.cs" />
    115113    <Compile Include="Interfaces\ISymbolicRegressionSolution.cs" />
    116114    <Compile Include="Interfaces\ISymbolicRegressionEvaluator.cs" />
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs

    r5722 r5733  
    3131  [StorableClass]
    3232  [Creatable("Problems")]
    33   public class SymbolicRegressionMultiObjectiveProblem : SymbolicDataAnalysisMultiObjectiveProblem<IRegressionProblemData, ISymbolicRegressionMultiObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator> {
     33  public class SymbolicRegressionMultiObjectiveProblem : SymbolicDataAnalysisMultiObjectiveProblem<IRegressionProblemData, ISymbolicRegressionMultiObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem {
    3434    private const double PunishmentFactor = 10;
    3535    private const int InitialMaximumTreeDepth = 8;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r5722 r5733  
    3131  [StorableClass]
    3232  [Creatable("Problems")]
    33   public class SymbolicRegressionSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator> {
     33  public class SymbolicRegressionSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>,IRegressionProblem {
    3434    private const double PunishmentFactor = 10;
    3535    private const int InitialMaximumTreeDepth = 8;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs

    r5729 r5733  
    7373      ConstantTreeNode betaTreeNode = null;
    7474      // check if model has been scaled previously by analyzing the structure of the tree
    75       var startNode = Model.SymbolicExpressionTree.Root.GetSubTree(0);
    76       if (startNode.GetSubTree(0).Symbol is Addition) {
    77         var addNode = startNode.GetSubTree(0);
    78         if (addNode.SubtreesCount == 2 && addNode.GetSubTree(0).Symbol is Multiplication && addNode.GetSubTree(1).Symbol is Constant) {
    79           alphaTreeNode = addNode.GetSubTree(1) as ConstantTreeNode;
    80           var mulNode = addNode.GetSubTree(0);
    81           if (mulNode.SubtreesCount == 2 && mulNode.GetSubTree(1).Symbol is Constant) {
    82             betaTreeNode = mulNode.GetSubTree(1) as ConstantTreeNode;
     75      var startNode = Model.SymbolicExpressionTree.Root.GetSubtree(0);
     76      if (startNode.GetSubtree(0).Symbol is Addition) {
     77        var addNode = startNode.GetSubtree(0);
     78        if (addNode.SubtreesCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) {
     79          alphaTreeNode = addNode.GetSubtree(1) as ConstantTreeNode;
     80          var mulNode = addNode.GetSubtree(0);
     81          if (mulNode.SubtreesCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) {
     82            betaTreeNode = mulNode.GetSubtree(1) as ConstantTreeNode;
    8383          }
    8484        }
     
    9090        alphaTreeNode.Value += alpha;
    9191      } else {
    92         var mainBranch = startNode.GetSubTree(0);
    93         startNode.RemoveSubTree(0);
     92        var mainBranch = startNode.GetSubtree(0);
     93        startNode.RemoveSubtree(0);
    9494        var scaledMainBranch = MakeSum(MakeProduct(beta, mainBranch), alpha);
    95         startNode.AddSubTree(scaledMainBranch);
     95        startNode.AddSubtree(scaledMainBranch);
    9696      }
    9797
     
    105105        var node = (new Addition()).CreateTreeNode();
    106106        var alphaConst = MakeConstant(alpha);
    107         node.AddSubTree(treeNode);
    108         node.AddSubTree(alphaConst);
     107        node.AddSubtree(treeNode);
     108        node.AddSubtree(alphaConst);
    109109        return node;
    110110      }
     
    117117        var node = (new Multiplication()).CreateTreeNode();
    118118        var betaConst = MakeConstant(beta);
    119         node.AddSubTree(treeNode);
    120         node.AddSubTree(betaConst);
     119        node.AddSubtree(treeNode);
     120        node.AddSubtree(betaConst);
    121121        return node;
    122122      }
Note: See TracChangeset for help on using the changeset viewer.