Changeset 12287 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs
- Timestamp:
- 04/06/15 16:39:55 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs
r12155 r12287 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Data; 26 using HeuristicLab.Parameters; 25 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 28 … … 29 31 [StorableClass] 30 32 public class SymbolicDataAnalysisBottomUpDiversityAnalyzer : PopulationSimilarityAnalyzer { 33 private const string MatchConstantValuesParameterName = "MatchConstantValues"; 34 private const string MatchVariableWeightsParameterName = "MatchVariableWeights"; 35 36 public IFixedValueParameter<BoolValue> MatchConstantValuesParameter { 37 get { return (IFixedValueParameter<BoolValue>)Parameters[MatchConstantValuesParameterName]; } 38 } 39 40 public IFixedValueParameter<BoolValue> MatchVariableWeightsParameter { 41 get { return (IFixedValueParameter<BoolValue>)Parameters[MatchVariableWeightsParameterName]; } 42 } 43 44 public bool MatchConstantValues { 45 get { return MatchConstantValuesParameter.Value.Value; } 46 set { 47 MatchConstantValuesParameter.Value.Value = value; 48 49 } 50 } 51 52 public bool MatchVariableWeights { 53 get { return MatchVariableWeightsParameter.Value.Value; } 54 set { 55 MatchVariableWeightsParameter.Value.Value = value; 56 } 57 } 58 31 59 [StorableConstructor] 32 60 protected SymbolicDataAnalysisBottomUpDiversityAnalyzer(bool deserializing) : base(deserializing) { } … … 44 72 DiversityResultName = "Genotypic Diversity"; 45 73 UpdateCounterParameter.ActualName = "GenotypicDiversityAnalyzerUpdateCounter"; 74 75 Parameters.Add(new FixedValueParameter<BoolValue>(MatchConstantValuesParameterName, new BoolValue(true))); 76 Parameters.Add(new FixedValueParameter<BoolValue>(MatchVariableWeightsParameterName, new BoolValue(true))); 77 } 78 79 public override IOperation Apply() { 80 var bus = (SymbolicExpressionTreeBottomUpSimilarityCalculator)SimilarityCalculatorParameter.Value; 81 bus.MatchConstantValues = MatchConstantValues; 82 bus.MatchVariableWeights = MatchVariableWeights; 83 return base.Apply(); 46 84 } 47 85 }
Note: See TracChangeset
for help on using the changeset viewer.