- Timestamp:
- 07/23/20 16:21:55 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.GrammaticalEvolution/3.4/SymbolicRegression
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GrammaticalEvolution/3.4/SymbolicRegression/GESymbolicDataAnalysisProblem.cs
r17520 r17695 26 26 using System.Drawing; 27 27 using System.Linq; 28 using HEAL.Attic; 28 29 using HeuristicLab.Common; 29 30 using HeuristicLab.Common.Resources; … … 34 35 using HeuristicLab.Optimization; 35 36 using HeuristicLab.Parameters; 36 using HEAL.Attic;37 37 using HeuristicLab.PluginInfrastructure; 38 38 using HeuristicLab.Problems.DataAnalysis; … … 43 43 namespace HeuristicLab.Problems.GrammaticalEvolution { 44 44 [StorableType("E31AC1E8-590D-4D65-883F-3113544B6C91")] 45 public abstract class GESymbolicDataAnalysisProblem<T, U , V> : HeuristicOptimizationProblem<U, V>, IDataAnalysisProblem<T>,45 public abstract class GESymbolicDataAnalysisProblem<T, U> : HeuristicOptimizationProblem<U>, IDataAnalysisProblem<T>, 46 46 IGESymbolicDataAnalysisProblem, IStorableContent, 47 47 IProblemInstanceConsumer<T>, IProblemInstanceExporter<T> 48 48 where T : class, IDataAnalysisProblemData 49 where U : class, IGESymbolicDataAnalysisEvaluator<T> 50 where V : class, IIntegerVectorCreator { 49 where U : class, IGESymbolicDataAnalysisEvaluator<T> { 51 50 52 51 #region parameter names & descriptions … … 152 151 RegisterEventHandlers(); 153 152 } 154 protected GESymbolicDataAnalysisProblem(GESymbolicDataAnalysisProblem<T, U , V> original, Cloner cloner)153 protected GESymbolicDataAnalysisProblem(GESymbolicDataAnalysisProblem<T, U> original, Cloner cloner) 155 154 : base(original, cloner) { 156 155 RegisterEventHandlers(); 157 156 } 158 157 159 protected GESymbolicDataAnalysisProblem(T problemData, U evaluator , V solutionCreator)160 : base(evaluator , solutionCreator) {158 protected GESymbolicDataAnalysisProblem(T problemData, U evaluator) 159 : base(evaluator) { 161 160 Parameters.Add(new ValueParameter<T>(ProblemDataParameterName, ProblemDataParameterDescription, problemData)); 162 161 Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(SymbolicExpressionTreeGrammarParameterName, SymbolicExpressionTreeGrammarParameterDescription)); … … 267 266 op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name; 268 267 op.ApplyLinearScalingParameter.ActualName = ApplyLinearScalingParameter.Name; 269 op.IntegerVectorParameter.ActualName = SolutionCreator.IntegerVectorParameter.Name;268 //op.IntegerVectorParameter.ActualName = SolutionCreator.IntegerVectorParameter.Name; 270 269 op.GenotypeToPhenotypeMapperParameter.ActualName = GenotypeToPhenotypeMapperParameter.Name; 271 270 op.SymbolicExpressionTreeGrammarParameter.ActualName = SymbolicExpressionTreeGrammarParameter.Name; 272 271 } 273 272 foreach (var op in operators.OfType<IIntegerVectorCrossover>()) { 274 op.ParentsParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName;275 op.ChildParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName;273 //op.ParentsParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName; 274 //op.ChildParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName; 276 275 } 277 276 foreach (var op in operators.OfType<IIntegerVectorManipulator>()) { 278 op.IntegerVectorParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName;277 //op.IntegerVectorParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName; 279 278 } 280 279 foreach (var op in operators.OfType<IIntegerVectorCreator>()) { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GrammaticalEvolution/3.4/SymbolicRegression/GESymbolicDataAnalysisSingleObjectiveProblem.cs
r17226 r17695 24 24 using System; 25 25 using System.Linq; 26 using HEAL.Attic; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; 28 29 using HeuristicLab.Data; 29 using HeuristicLab.Encodings.IntegerVectorEncoding;30 30 using HeuristicLab.Optimization; 31 31 using HeuristicLab.Parameters; 32 using HEAL.Attic;33 32 using HeuristicLab.Problems.DataAnalysis; 34 33 using HeuristicLab.Problems.DataAnalysis.Symbolic; … … 36 35 namespace HeuristicLab.Problems.GrammaticalEvolution { 37 36 [StorableType("27E01C21-6772-4CE5-8301-EF3102D1BB28")] 38 public abstract class GESymbolicDataAnalysisSingleObjectiveProblem<T, U , V> : GESymbolicDataAnalysisProblem<T, U, V>,37 public abstract class GESymbolicDataAnalysisSingleObjectiveProblem<T, U> : GESymbolicDataAnalysisProblem<T, U>, 39 38 IGESymbolicDataAnalysisSingleObjectiveProblem 40 39 where T : class, IDataAnalysisProblemData 41 where U : class, IGESymbolicDataAnalysisSingleObjectiveEvaluator<T> 42 where V : class, IIntegerVectorCreator { 40 where U : class, IGESymbolicDataAnalysisSingleObjectiveEvaluator<T> { 43 41 private const string MaximizationParameterName = "Maximization"; 44 42 private const string BestKnownQualityParameterName = "BestKnownQuality"; … … 73 71 [StorableConstructor] 74 72 protected GESymbolicDataAnalysisSingleObjectiveProblem(StorableConstructorFlag _) : base(_) { } 75 protected GESymbolicDataAnalysisSingleObjectiveProblem(GESymbolicDataAnalysisSingleObjectiveProblem<T, U , V> original, Cloner cloner)73 protected GESymbolicDataAnalysisSingleObjectiveProblem(GESymbolicDataAnalysisSingleObjectiveProblem<T, U> original, Cloner cloner) 76 74 : base(original, cloner) { 77 75 RegisterEventHandler(); … … 79 77 } 80 78 81 public GESymbolicDataAnalysisSingleObjectiveProblem(T problemData, U evaluator , V solutionCreator)82 : base(problemData, evaluator , solutionCreator) {79 public GESymbolicDataAnalysisSingleObjectiveProblem(T problemData, U evaluator) 80 : base(problemData, evaluator) { 83 81 Parameters.Add(new FixedValueParameter<BoolValue>(MaximizationParameterName, "Set to false if the problem should be minimized.")); 84 82 Parameters.Add(new FixedValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem.")); -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GrammaticalEvolution/3.4/SymbolicRegression/GESymbolicRegressionSingleObjectiveProblem.cs
r17226 r17695 24 24 25 25 using System.Linq; 26 using HEAL.Attic; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; 28 using HeuristicLab.Encodings.IntegerVectorEncoding;29 29 using HeuristicLab.Parameters; 30 using HEAL.Attic;31 30 using HeuristicLab.Problems.DataAnalysis; 32 31 using HeuristicLab.Problems.DataAnalysis.Symbolic; … … 38 37 [StorableType("65208F51-3181-4765-BA04-33CADBCE0826")] 39 38 [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 180)] 40 public class GESymbolicRegressionSingleObjectiveProblem : GESymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, IGESymbolicRegressionSingleObjectiveEvaluator , IIntegerVectorCreator>,39 public class GESymbolicRegressionSingleObjectiveProblem : GESymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, IGESymbolicRegressionSingleObjectiveEvaluator>, 41 40 IRegressionProblem { 42 41 private const double PunishmentFactor = 10; … … 65 64 66 65 public GESymbolicRegressionSingleObjectiveProblem() 67 : base(new RegressionProblemData(), new GESymbolicRegressionSingleObjectiveEvaluator() , new UniformRandomIntegerVectorCreator()) {66 : base(new RegressionProblemData(), new GESymbolicRegressionSingleObjectiveEvaluator()) { 68 67 Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription)); 69 68
Note: See TracChangeset
for help on using the changeset viewer.