Changeset 10226 for branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Symbolic
- Timestamp:
- 12/14/13 17:38:57 (11 years ago)
- 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 40 40 namespace HeuristicLab.Problems.GrammaticalEvolution { 41 41 [StorableClass] 42 // TODO: ISymbolicDataAnalysisProblem -> IGESymbolicDataAnalysisProblem43 42 public abstract class GESymbolicDataAnalysisProblem<T, U, V> : HeuristicOptimizationProblem<U, V>, IDataAnalysisProblem<T>, 44 I SymbolicDataAnalysisProblem, IStorableContent,43 IGESymbolicDataAnalysisProblem, IStorableContent, 45 44 IProblemInstanceConsumer<T>, IProblemInstanceExporter<T> 46 45 where T : class, IDataAnalysisProblemData … … 52 51 private const string SymbolicExpressionTreeGrammarParameterName = "SymbolicExpressionTreeGrammar"; 53 52 private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter"; 54 private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";53 //private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth"; 55 54 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"; 58 57 private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples"; 59 58 private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition"; … … 91 90 get { return (IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; } 92 91 } 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 //} 96 95 public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter { 97 96 get { return (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; } 98 97 } 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 //} 105 104 public IFixedValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter { 106 105 get { return (IFixedValueParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; } … … 144 143 } 145 144 146 public IntValue MaximumSymbolicExpressionTreeDepth {147 get { return MaximumSymbolicExpressionTreeDepthParameter.Value; }148 }145 //public IntValue MaximumSymbolicExpressionTreeDepth { 146 // get { return MaximumSymbolicExpressionTreeDepthParameter.Value; } 147 //} 149 148 public IntValue MaximumSymbolicExpressionTreeLength { 150 149 get { return MaximumSymbolicExpressionTreeLengthParameter.Value; } 151 150 } 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 //} 158 157 public PercentValue RelativeNumberOfEvaluatedSamples { 159 158 get { return RelativeNumberOfEvaluatedSamplesParameter.Value; } … … 197 196 Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(SymbolicExpressionTreeGrammarParameterName, SymbolicExpressionTreeGrammarParameterDescription)); 198 197 Parameters.Add(new ValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, SymoblicExpressionTreeInterpreterParameterDescription)); 199 Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, MaximumSymbolicExpressionTreeDepthParameterDescription));198 //Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, MaximumSymbolicExpressionTreeDepthParameterDescription)); 200 199 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)); 203 202 Parameters.Add(new FixedValueParameter<IntRange>(FitnessCalculationPartitionParameterName, FitnessCalculationPartitionParameterDescription)); 204 203 Parameters.Add(new FixedValueParameter<IntRange>(ValidationPartitionParameterName, ValidationPartitionParameterDescription)); … … 210 209 211 210 SymbolicExpressionTreeInterpreterParameter.Hidden = true; 212 MaximumFunctionArgumentsParameter.Hidden = true;213 MaximumFunctionDefinitionsParameter.Hidden = true;211 //MaximumFunctionArgumentsParameter.Hidden = true; 212 //MaximumFunctionDefinitionsParameter.Hidden = true; 214 213 ApplyLinearScalingParameter.Hidden = true; 215 214 … … 227 226 228 227 protected virtual void UpdateGrammar() { 229 SymbolicExpressionTreeGrammar.MaximumFunctionArguments = MaximumFunctionArguments.Value;230 SymbolicExpressionTreeGrammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value;228 //SymbolicExpressionTreeGrammar.MaximumFunctionArguments = MaximumFunctionArguments.Value; 229 //SymbolicExpressionTreeGrammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value; 231 230 foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Variable>()) { 232 231 if (!varSymbol.Fixed) { … … 260 259 SymbolicExpressionTreeGrammarParameter.ValueChanged += new EventHandler(SymbolicExpressionTreeGrammarParameter_ValueChanged); 261 260 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); 265 264 } 266 265 … … 280 279 } 281 280 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 //} 293 290 294 291 protected override void OnEvaluatorChanged() { -
branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Symbolic/GESymbolicDataAnalysisSingleObjectiveProblem.cs
r10075 r10226 35 35 [StorableClass] 36 36 public abstract class GESymbolicDataAnalysisSingleObjectiveProblem<T, U, V> : GESymbolicDataAnalysisProblem<T, U, V>, 37 I SymbolicDataAnalysisSingleObjectiveProblem37 IGESymbolicDataAnalysisSingleObjectiveProblem 38 38 where T : class, IDataAnalysisProblemData 39 39 where U : class, IGESymbolicDataAnalysisSingleObjectiveEvaluator<T> -
branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Symbolic/GESymbolicRegressionSingleObjectiveProblem.cs
r10075 r10226 37 37 IRegressionProblem { 38 38 private const double PunishmentFactor = 10; 39 private const int InitialMaximumTreeDepth = 8;39 //private const int InitialMaximumTreeDepth = 8; 40 40 private const int InitialMaximumTreeLength = 25; 41 41 private const string EstimationLimitsParameterName = "EstimationLimits"; … … 69 69 ApplyLinearScalingParameter.Value.Value = true; 70 70 Maximization.Value = true; 71 MaximumSymbolicExpressionTreeDepth.Value = InitialMaximumTreeDepth;71 //MaximumSymbolicExpressionTreeDepth.Value = InitialMaximumTreeDepth; 72 72 MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength; 73 73
Note: See TracChangeset
for help on using the changeset viewer.