Changeset 11197 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers
- Timestamp:
- 07/16/14 16:32:48 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisPopulationDiversityAnalyzer.cs
r10464 r11197 49 49 private const string StoreHistoryParameterName = "StoreHistory"; 50 50 // comparer parameters 51 private const string MatchVariablesParameterName = "MatchVariableNames";52 private const string MatchVariableWeightsParameterName = "MatchVariableWeights";53 private const string MatchConstantValuesParameterName = "MatchConstantValues";54 51 private const string SimilarityValuesParmeterName = "Similarity"; 52 53 private const string DistanceCalculatorParameterName = "DistanceCalculator"; 55 54 56 55 #endregion … … 78 77 get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 79 78 } 80 public ValueParameter<BoolValue> MatchVariableNamesParameter {81 get { return (ValueParameter<BoolValue>)Parameters[MatchVariablesParameterName]; }82 }83 public ValueParameter<BoolValue> MatchVariableWeightsParameter {84 get { return (ValueParameter<BoolValue>)Parameters[MatchVariableWeightsParameterName]; }85 }86 public ValueParameter<BoolValue> MatchConstantValuesParameter {87 get { return (ValueParameter<BoolValue>)Parameters[MatchConstantValuesParameterName]; }88 }89 79 public ILookupParameter<DoubleValue> SimilarityParameter { 90 80 get { return (ILookupParameter<DoubleValue>)Parameters[SimilarityValuesParmeterName]; } 81 } 82 public IValueParameter<IDistanceCalculator> DistanceCalculatorParameter { 83 get { return (IValueParameter<IDistanceCalculator>)Parameters[DistanceCalculatorParameterName]; } 91 84 } 92 85 #endregion … … 122 115 Parameters.Add(new ValueLookupParameter<ResultCollection>(ResultsParameterName, "The results collection where the analysis values should be stored.")); 123 116 Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations so far.")); 124 Parameters.Add(new ValueParameter<BoolValue>(MatchVariablesParameterName, "Specify if the symbolic expression tree comparer should match variable names.", new BoolValue(true)));125 Parameters.Add(new ValueParameter<BoolValue>(MatchVariableWeightsParameterName, "Specify if the symbolic expression tree comparer should match variable weights.", new BoolValue(true)));126 Parameters.Add(new ValueParameter<BoolValue>(MatchConstantValuesParameterName, "Specify if the symbolic expression tree comparer should match constant values.", new BoolValue(true)));127 117 Parameters.Add(new ValueParameter<BoolValue>(StoreHistoryParameterName, "True if the tree lengths history of the population should be stored.", new BoolValue(false))); 128 118 Parameters.Add(new LookupParameter<DoubleValue>(SimilarityValuesParmeterName, "")); 129 119 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0).")); 120 Parameters.Add(new ValueParameter<IDistanceCalculator>(DistanceCalculatorParameterName, "The distance calculator between trees.", new BottomUpDistanceCalculator())); 130 121 UpdateCounterParameter.Hidden = true; 131 122 UpdateIntervalParameter.Hidden = true; … … 159 150 SimilarityParameter.ActualValue = new DoubleValue(); 160 151 161 var comparer = new SymbolicExpressionTreeNodeSimilarityComparer {162 MatchConstantValues = MatchConstantValuesParameter.Value.Value,163 MatchVariableNames = MatchVariableNamesParameter.Value.Value,164 MatchVariableWeights = MatchVariableWeightsParameter.Value.Value165 };166 167 152 var operations = new OperationCollection { Parallel = true }; 168 153 foreach (var tree in trees) { 169 var op = new SymbolicDataAnalysisExpressionTreeSimilarityCalculator {154 var op = new SymbolicDataAnalysisExpressionTreeSimilarityCalculator(DistanceCalculatorParameter.Value) { 170 155 CurrentSymbolicExpressionTree = tree, 171 SimilarityComparer = comparer,172 156 MaximumTreeDepth = MaximumSymbolicExpressionTreeDepth.Value 173 157 };
Note: See TracChangeset
for help on using the changeset viewer.