Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/24/15 17:07:41 (9 years ago)
Author:
bburlacu
Message:

#2326: Fixed mistakes and wired similarity calculators directly into the problem and correctly initialized the properties of the phenotypic similarity calculator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SymbolicExpressionTreeDiversityAnalyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r12049 r12068  
    112112      Operators.Add(new SymbolicRegressionSolutionsAnalyzer());
    113113      Operators.Add(new SymbolicRegressionPhenotypicDiversityAnalyzer());
     114      Operators.Add(new SymbolicExpressionTreePhenotypicSimilarityCalculator());
    114115      ParameterizeOperators();
    115116    }
     
    141142        }
    142143      }
     144
     145      foreach (var op in Operators.OfType<SymbolicExpressionTreePhenotypicSimilarityCalculator>()) {
     146        op.SolutionVariableName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     147        op.ProblemData = ProblemData;
     148        op.Interpreter = SymbolicExpressionTreeInterpreter;
     149      }
     150
    143151      foreach (var op in Operators.OfType<SymbolicRegressionPhenotypicDiversityAnalyzer>()) {
    144         var sim = op.SimilarityCalculator as SymbolicExpressionTreePhenotypicSimilarityCalculator;
    145         if (sim == null) {
    146           op.SimilarityCalculator = new SymbolicExpressionTreePhenotypicSimilarityCalculator {
    147             SolutionVariableName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName
    148           };
    149         } else {
    150           sim.SolutionVariableName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    151         }
     152        var sim = Operators.OfType<SymbolicExpressionTreePhenotypicSimilarityCalculator>().FirstOrDefault();
     153        if (sim != null)
     154          op.SimilarityCalculator = sim;
    152155      }
    153156    }
Note: See TracChangeset for help on using the changeset viewer.