Changeset 11482 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers
- Timestamp:
- 10/21/14 01:31:20 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs
r11291 r11482 22 22 using HeuristicLab.Analysis; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 25 using HeuristicLab.Parameters; 24 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 27 … … 28 30 [StorableClass] 29 31 public class SymbolicDataAnalysisBottomUpDiversityAnalyzer : SingleObjectivePopulationDiversityAnalyzer { 32 private const string MatchConstantValuesParameterName = "MatchConstantValues"; 33 private const string MatchVariableWeightsParameterName = "MatchVariableWeights"; 34 35 public IValueParameter<BoolValue> MatchVariableWeightsParameter { 36 get { return (IValueParameter<BoolValue>)Parameters[MatchVariableWeightsParameterName]; } 37 } 38 39 public IValueParameter<BoolValue> MatchConstantValuesParameter { 40 get { return (IValueParameter<BoolValue>)Parameters[MatchConstantValuesParameterName]; } 41 } 42 43 public bool MatchConstantValues { 44 get { return MatchConstantValuesParameter.Value.Value; } 45 set { 46 MatchConstantValuesParameter.Value.Value = value; 47 ((BottomUpSimilarityCalculator)SimilarityCalculator).MatchConstantValues = value; 48 } 49 } 50 51 public bool MatchVariableWeights { 52 get { return MatchVariableWeightsParameter.Value.Value; } 53 set { 54 MatchVariableWeightsParameter.Value.Value = value; 55 ((BottomUpSimilarityCalculator)SimilarityCalculator).MatchVariableWeights = value; 56 } 57 } 58 30 59 [StorableConstructor] 31 60 protected SymbolicDataAnalysisBottomUpDiversityAnalyzer(bool deserializing) : base(deserializing) { } 32 61 62 [StorableHook(HookType.AfterDeserialization)] 63 private void AfterDeserialization() { 64 if (!Parameters.ContainsKey(MatchConstantValuesParameterName)) 65 Parameters.Add(new ValueParameter<BoolValue>(MatchConstantValuesParameterName, "Specifies if the similarity calculator should match constant values.", new BoolValue(true))); 66 if (!Parameters.ContainsKey(MatchVariableWeightsParameterName)) 67 Parameters.Add(new ValueParameter<BoolValue>(MatchVariableWeightsParameterName, "Specifies if the similarity calculator should match variable weights", new BoolValue(true))); 68 } 69 33 70 public SymbolicDataAnalysisBottomUpDiversityAnalyzer() { 34 71 SimilarityCalculator = new BottomUpSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" }; 72 Parameters.Add(new ValueParameter<BoolValue>(MatchConstantValuesParameterName, "Specifies if the similarity calculator should match constant values.", new BoolValue(true))); 73 Parameters.Add(new ValueParameter<BoolValue>(MatchVariableWeightsParameterName, "Specifies if the similarity calculator should match variable weights", new BoolValue(true))); 35 74 } 36 75 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer.cs
r11473 r11482 25 25 26 26 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Analyzers { 27 [Item("SymbolicDataAnalysis BottomUpDiversityAnalyzer", "A diversity analyzer based on the bottom-upsimilarity between trees.")]27 [Item("SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer", "A diversity analyzer based on the max common subtree similarity between trees.")] 28 28 [StorableClass] 29 public class SymbolicDataAnalysis BottomUpDiversityAnalyzer : SingleObjectivePopulationDiversityAnalyzer {29 public class SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer : SingleObjectivePopulationDiversityAnalyzer { 30 30 [StorableConstructor] 31 protected SymbolicDataAnalysis BottomUpDiversityAnalyzer(bool deserializing) : base(deserializing) { }31 protected SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer(bool deserializing) : base(deserializing) { } 32 32 33 public SymbolicDataAnalysis BottomUpDiversityAnalyzer() {34 SimilarityCalculator = new BottomUpSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" };33 public SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer() { 34 SimilarityCalculator = new MaxCommonSubtreeSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" }; 35 35 } 36 36 }
Note: See TracChangeset
for help on using the changeset viewer.