Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10226


Ignore:
Timestamp:
12/14/13 17:38:57 (11 years ago)
Author:
sawinkle
Message:

#2109:

  • Added file IGESymbolicDataAnalysisProblem.cs to determine, which parameters should be used. => Removed parameters MaximumSymbolicExpressionTreeDepthParameter, MaximumFunctionDefinitionsParameter and MaximumFunctionArgumentsParameter, which are unnecessary for Grammatical Evolution.
  • Adapted the other files to use the interfaces of the new file IGESymbolicDataAnalysisProblem.cs
Location:
branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Symbolic
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Symbolic/GESymbolicDataAnalysisProblem.cs

    r10075 r10226  
    4040namespace HeuristicLab.Problems.GrammaticalEvolution {
    4141  [StorableClass]
    42   // TODO: ISymbolicDataAnalysisProblem -> IGESymbolicDataAnalysisProblem
    4342  public abstract class GESymbolicDataAnalysisProblem<T, U, V> : HeuristicOptimizationProblem<U, V>, IDataAnalysisProblem<T>,
    44                                                                  ISymbolicDataAnalysisProblem, IStorableContent,
     43                                                                 IGESymbolicDataAnalysisProblem, IStorableContent,
    4544                                                                 IProblemInstanceConsumer<T>, IProblemInstanceExporter<T>
    4645    where T : class, IDataAnalysisProblemData
     
    5251    private const string SymbolicExpressionTreeGrammarParameterName = "SymbolicExpressionTreeGrammar";
    5352    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
    54     private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
     53    //private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
    5554    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
    56     private const string MaximumFunctionDefinitionsParameterName = "MaximumFunctionDefinitions";
    57     private const string MaximumFunctionArgumentsParameterName = "MaximumFunctionArguments";
     55    //private const string MaximumFunctionDefinitionsParameterName = "MaximumFunctionDefinitions";
     56    //private const string MaximumFunctionArgumentsParameterName = "MaximumFunctionArguments";
    5857    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
    5958    private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
     
    9190      get { return (IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
    9291    }
    93     public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
    94       get { return (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
    95     }
     92    //public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
     93    //  get { return (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
     94    //}
    9695    public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
    9796      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
    9897    }
    99     public IFixedValueParameter<IntValue> MaximumFunctionDefinitionsParameter {
    100       get { return (IFixedValueParameter<IntValue>)Parameters[MaximumFunctionDefinitionsParameterName]; }
    101     }
    102     public IFixedValueParameter<IntValue> MaximumFunctionArgumentsParameter {
    103       get { return (IFixedValueParameter<IntValue>)Parameters[MaximumFunctionArgumentsParameterName]; }
    104     }
     98    //public IFixedValueParameter<IntValue> MaximumFunctionDefinitionsParameter {
     99    //  get { return (IFixedValueParameter<IntValue>)Parameters[MaximumFunctionDefinitionsParameterName]; }
     100    //}
     101    //public IFixedValueParameter<IntValue> MaximumFunctionArgumentsParameter {
     102    //  get { return (IFixedValueParameter<IntValue>)Parameters[MaximumFunctionArgumentsParameterName]; }
     103    //}
    105104    public IFixedValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
    106105      get { return (IFixedValueParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
     
    144143    }
    145144
    146     public IntValue MaximumSymbolicExpressionTreeDepth {
    147       get { return MaximumSymbolicExpressionTreeDepthParameter.Value; }
    148     }
     145    //public IntValue MaximumSymbolicExpressionTreeDepth {
     146    //  get { return MaximumSymbolicExpressionTreeDepthParameter.Value; }
     147    //}
    149148    public IntValue MaximumSymbolicExpressionTreeLength {
    150149      get { return MaximumSymbolicExpressionTreeLengthParameter.Value; }
    151150    }
    152     public IntValue MaximumFunctionDefinitions {
    153       get { return MaximumFunctionDefinitionsParameter.Value; }
    154     }
    155     public IntValue MaximumFunctionArguments {
    156       get { return MaximumFunctionArgumentsParameter.Value; }
    157     }
     151    //public IntValue MaximumFunctionDefinitions {
     152    //  get { return MaximumFunctionDefinitionsParameter.Value; }
     153    //}
     154    //public IntValue MaximumFunctionArguments {
     155    //  get { return MaximumFunctionArgumentsParameter.Value; }
     156    //}
    158157    public PercentValue RelativeNumberOfEvaluatedSamples {
    159158      get { return RelativeNumberOfEvaluatedSamplesParameter.Value; }
     
    197196      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(SymbolicExpressionTreeGrammarParameterName, SymbolicExpressionTreeGrammarParameterDescription));
    198197      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, SymoblicExpressionTreeInterpreterParameterDescription));
    199       Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, MaximumSymbolicExpressionTreeDepthParameterDescription));
     198      //Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, MaximumSymbolicExpressionTreeDepthParameterDescription));
    200199      Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, MaximumSymbolicExpressionTreeLengthParameterDescription));
    201       Parameters.Add(new FixedValueParameter<IntValue>(MaximumFunctionDefinitionsParameterName, MaximumFunctionDefinitionsParameterDescription));
    202       Parameters.Add(new FixedValueParameter<IntValue>(MaximumFunctionArgumentsParameterName, MaximumFunctionArgumentsParameterDescription));
     200      //Parameters.Add(new FixedValueParameter<IntValue>(MaximumFunctionDefinitionsParameterName, MaximumFunctionDefinitionsParameterDescription));
     201      //Parameters.Add(new FixedValueParameter<IntValue>(MaximumFunctionArgumentsParameterName, MaximumFunctionArgumentsParameterDescription));
    203202      Parameters.Add(new FixedValueParameter<IntRange>(FitnessCalculationPartitionParameterName, FitnessCalculationPartitionParameterDescription));
    204203      Parameters.Add(new FixedValueParameter<IntRange>(ValidationPartitionParameterName, ValidationPartitionParameterDescription));
     
    210209
    211210      SymbolicExpressionTreeInterpreterParameter.Hidden = true;
    212       MaximumFunctionArgumentsParameter.Hidden = true;
    213       MaximumFunctionDefinitionsParameter.Hidden = true;
     211      //MaximumFunctionArgumentsParameter.Hidden = true;
     212      //MaximumFunctionDefinitionsParameter.Hidden = true;
    214213      ApplyLinearScalingParameter.Hidden = true;
    215214
     
    227226
    228227    protected virtual void UpdateGrammar() {
    229       SymbolicExpressionTreeGrammar.MaximumFunctionArguments = MaximumFunctionArguments.Value;
    230       SymbolicExpressionTreeGrammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value;
     228      //SymbolicExpressionTreeGrammar.MaximumFunctionArguments = MaximumFunctionArguments.Value;
     229      //SymbolicExpressionTreeGrammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value;
    231230      foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Variable>()) {
    232231        if (!varSymbol.Fixed) {
     
    260259      SymbolicExpressionTreeGrammarParameter.ValueChanged += new EventHandler(SymbolicExpressionTreeGrammarParameter_ValueChanged);
    261260
    262       MaximumFunctionArguments.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
    263       MaximumFunctionDefinitions.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
    264       MaximumSymbolicExpressionTreeDepth.ValueChanged += new EventHandler(MaximumSymbolicExpressionTreeDepth_ValueChanged);
     261      //MaximumFunctionArguments.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
     262      //MaximumFunctionDefinitions.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
     263      //MaximumSymbolicExpressionTreeDepth.ValueChanged += new EventHandler(MaximumSymbolicExpressionTreeDepth_ValueChanged);
    265264    }
    266265
     
    280279    }
    281280
    282     private void MaximumSymbolicExpressionTreeDepth_ValueChanged(object sender, EventArgs e) {
    283       if (MaximumSymbolicExpressionTreeDepth != null && MaximumSymbolicExpressionTreeDepth.Value < 3)
    284         MaximumSymbolicExpressionTreeDepth.Value = 3;
    285     }
    286 
    287     /*
    288     protected override void OnSolutionCreatorChanged() {
    289       base.OnSolutionCreatorChanged();
    290       ParameterizeOperators();
    291     }
    292     */
     281    //private void MaximumSymbolicExpressionTreeDepth_ValueChanged(object sender, EventArgs e) {
     282    //  if (MaximumSymbolicExpressionTreeDepth != null && MaximumSymbolicExpressionTreeDepth.Value < 3)
     283    //    MaximumSymbolicExpressionTreeDepth.Value = 3;
     284    //}
     285
     286    //protected override void OnSolutionCreatorChanged() {
     287    //  base.OnSolutionCreatorChanged();
     288    //  ParameterizeOperators();
     289    //}
    293290
    294291    protected override void OnEvaluatorChanged() {
  • branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Symbolic/GESymbolicDataAnalysisSingleObjectiveProblem.cs

    r10075 r10226  
    3535  [StorableClass]
    3636  public abstract class GESymbolicDataAnalysisSingleObjectiveProblem<T, U, V> : GESymbolicDataAnalysisProblem<T, U, V>,
    37                                                                                 ISymbolicDataAnalysisSingleObjectiveProblem
     37                                                                                IGESymbolicDataAnalysisSingleObjectiveProblem
    3838    where T : class, IDataAnalysisProblemData
    3939    where U : class, IGESymbolicDataAnalysisSingleObjectiveEvaluator<T>
  • branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Symbolic/GESymbolicRegressionSingleObjectiveProblem.cs

    r10075 r10226  
    3737                                                            IRegressionProblem {
    3838    private const double PunishmentFactor = 10;
    39     private const int InitialMaximumTreeDepth = 8;
     39    //private const int InitialMaximumTreeDepth = 8;
    4040    private const int InitialMaximumTreeLength = 25;
    4141    private const string EstimationLimitsParameterName = "EstimationLimits";
     
    6969      ApplyLinearScalingParameter.Value.Value = true;
    7070      Maximization.Value = true;
    71       MaximumSymbolicExpressionTreeDepth.Value = InitialMaximumTreeDepth;
     71      //MaximumSymbolicExpressionTreeDepth.Value = InitialMaximumTreeDepth;
    7272      MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
    7373
Note: See TracChangeset for help on using the changeset viewer.