Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/06/15 19:01:26 (10 years ago)
Author:
bburlacu
Message:

#1772: Merged trunk changes and updated the SymbolicDataAnalysisBottomUpDiversityAnalyzer.

Location:
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic

  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs

    r11927 r11965  
    2222using HeuristicLab.Analysis;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    25 using HeuristicLab.Parameters;
    2624using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2725
     
    3028  [StorableClass]
    3129  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         ((SymbolicExpressionTreeBottomUpSimilarityCalculator)SimilarityCalculator).MatchConstantValues = value;
    48       }
    49     }
    50 
    51     public bool MatchVariableWeights {
    52       get { return MatchVariableWeightsParameter.Value.Value; }
    53       set {
    54         MatchVariableWeightsParameter.Value.Value = value;
    55         ((SymbolicExpressionTreeBottomUpSimilarityCalculator)SimilarityCalculator).MatchVariableWeights = value;
    56       }
    57     }
    58 
    5930    [StorableConstructor]
    6031    protected SymbolicDataAnalysisBottomUpDiversityAnalyzer(bool deserializing) : base(deserializing) { }
     
    6233    [StorableHook(HookType.AfterDeserialization)]
    6334    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)));
    6835    }
    6936
    7037    public SymbolicDataAnalysisBottomUpDiversityAnalyzer() {
    7138      SimilarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator { 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)));
    7439    }
    7540  }
Note: See TracChangeset for help on using the changeset viewer.