- Timestamp:
- 07/23/20 16:21:55 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisMultiObjectiveProblem.cs
r17317 r17695 31 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 32 32 [StorableType("E9876DF8-ACFA-41C8-93B7-FA40C57CE459")] 33 public abstract class SymbolicDataAnalysisMultiObjectiveProblem<T, U , V> : SymbolicDataAnalysisProblem<T, U, V>, ISymbolicDataAnalysisMultiObjectiveProblem33 public abstract class SymbolicDataAnalysisMultiObjectiveProblem<T, U> : SymbolicDataAnalysisProblem<T, U>, ISymbolicDataAnalysisMultiObjectiveProblem 34 34 where T : class,IDataAnalysisProblemData 35 where U : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<T> 36 where V : class, ISymbolicDataAnalysisSolutionCreator { 35 where U : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<T> { 37 36 private const string MaximizationParameterName = "Maximization"; 38 37 private const string BestKnownQualityParameterName = "BestKnownQuality"; … … 59 58 [StorableConstructor] 60 59 protected SymbolicDataAnalysisMultiObjectiveProblem(StorableConstructorFlag _) : base(_) { } 61 protected SymbolicDataAnalysisMultiObjectiveProblem(SymbolicDataAnalysisMultiObjectiveProblem<T, U , V> original, Cloner cloner)60 protected SymbolicDataAnalysisMultiObjectiveProblem(SymbolicDataAnalysisMultiObjectiveProblem<T, U> original, Cloner cloner) 62 61 : base(original, cloner) { 63 62 RegisterEventHandler(); 64 63 } 65 64 66 public SymbolicDataAnalysisMultiObjectiveProblem(T problemData, U evaluator , V solutionCreator)67 : base(problemData, evaluator , solutionCreator) {65 public SymbolicDataAnalysisMultiObjectiveProblem(T problemData, U evaluator) 66 : base(problemData, evaluator) { 68 67 Parameters.Add(new ValueParameter<BoolArray>(MaximizationParameterName, "Set to false if the problem should be minimized.")); 69 68 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
r17520 r17695 37 37 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 38 38 [StorableType("59935E69-C4A5-480E-8FFB-D9669DE9BFD4")] 39 public abstract class SymbolicDataAnalysisProblem<T, U , V> : HeuristicOptimizationProblem<U, V>, IDataAnalysisProblem<T>, ISymbolicDataAnalysisProblem, IStorableContent,39 public abstract class SymbolicDataAnalysisProblem<T, U> : HeuristicOptimizationProblem<U>, IDataAnalysisProblem<T>, ISymbolicDataAnalysisProblem, IStorableContent, 40 40 IProblemInstanceConsumer<T>, IProblemInstanceExporter<T> 41 41 where T : class, IDataAnalysisProblemData 42 where U : class, ISymbolicDataAnalysisEvaluator<T> 43 where V : class, ISymbolicDataAnalysisSolutionCreator { 42 where U : class, ISymbolicDataAnalysisEvaluator<T> { 44 43 45 44 #region parameter names & descriptions … … 169 168 RegisterEventHandlers(); 170 169 } 171 protected SymbolicDataAnalysisProblem(SymbolicDataAnalysisProblem<T, U , V> original, Cloner cloner)170 protected SymbolicDataAnalysisProblem(SymbolicDataAnalysisProblem<T, U> original, Cloner cloner) 172 171 : base(original, cloner) { 173 172 RegisterEventHandlers(); 174 173 } 175 174 176 protected SymbolicDataAnalysisProblem(T problemData, U evaluator , V solutionCreator)177 : base(evaluator , solutionCreator) {175 protected SymbolicDataAnalysisProblem(T problemData, U evaluator) 176 : base(evaluator) { 178 177 Parameters.Add(new ValueParameter<T>(ProblemDataParameterName, ProblemDataParameterDescription, problemData)); 179 178 Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(SymbolicExpressionTreeGrammarParameterName, SymbolicExpressionTreeGrammarParameterDescription)); … … 268 267 } 269 268 270 protected override void OnSolutionCreatorChanged() {271 base.OnSolutionCreatorChanged();272 SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged);273 ParameterizeOperators();274 }275 276 private void SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged(object sender, EventArgs e) {277 ParameterizeOperators();278 }279 280 269 protected override void OnEvaluatorChanged() { 281 270 base.OnEvaluatorChanged(); … … 314 303 foreach (var op in operators.OfType<ISymbolicDataAnalysisEvaluator<T>>()) { 315 304 op.ProblemDataParameter.ActualName = ProblemDataParameterName; 316 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;305 //op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 317 306 op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name; 318 307 op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name; … … 320 309 } 321 310 foreach (var op in operators.OfType<ISymbolicExpressionTreeCrossover>()) { 322 op.ParentsParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;323 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;311 //op.ParentsParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 312 //op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 324 313 } 325 314 foreach (var op in operators.OfType<ISymbolicExpressionTreeManipulator>()) { 326 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;315 //op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 327 316 } 328 317 foreach (var op in operators.OfType<ISymbolicExpressionTreeAnalyzer>()) { 329 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;318 //op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 330 319 } 331 320 foreach (var op in operators.OfType<ISymbolicDataAnalysisSingleObjectiveAnalyzer>()) { … … 336 325 } 337 326 foreach (var op in operators.OfType<ISymbolicDataAnalysisAnalyzer>()) { 338 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;327 //op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 339 328 } 340 329 foreach (var op in operators.OfType<ISymbolicDataAnalysisValidationAnalyzer<U, T>>()) { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSingleObjectiveProblem.cs
r17317 r17695 31 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 32 32 [StorableType("BC7E7414-64B5-4428-AA89-270F8EF6E35E")] 33 public abstract class SymbolicDataAnalysisSingleObjectiveProblem<T, U , V> : SymbolicDataAnalysisProblem<T, U, V>, ISymbolicDataAnalysisSingleObjectiveProblem33 public abstract class SymbolicDataAnalysisSingleObjectiveProblem<T, U> : SymbolicDataAnalysisProblem<T, U>, ISymbolicDataAnalysisSingleObjectiveProblem 34 34 where T : class,IDataAnalysisProblemData 35 where U : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<T> 36 where V : class, ISymbolicDataAnalysisSolutionCreator { 35 where U : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<T> { 37 36 private const string MaximizationParameterName = "Maximization"; 38 37 private const string BestKnownQualityParameterName = "BestKnownQuality"; … … 67 66 [StorableConstructor] 68 67 protected SymbolicDataAnalysisSingleObjectiveProblem(StorableConstructorFlag _) : base(_) { } 69 protected SymbolicDataAnalysisSingleObjectiveProblem(SymbolicDataAnalysisSingleObjectiveProblem<T, U , V> original, Cloner cloner)68 protected SymbolicDataAnalysisSingleObjectiveProblem(SymbolicDataAnalysisSingleObjectiveProblem<T, U> original, Cloner cloner) 70 69 : base(original, cloner) { 71 70 RegisterEventHandler(); … … 73 72 } 74 73 75 protected SymbolicDataAnalysisSingleObjectiveProblem(T problemData, U evaluator , V solutionCreator)76 : base(problemData, evaluator , solutionCreator) {74 protected SymbolicDataAnalysisSingleObjectiveProblem(T problemData, U evaluator) 75 : base(problemData, evaluator) { 77 76 Parameters.Add(new FixedValueParameter<BoolValue>(MaximizationParameterName, "Set to false if the problem should be minimized.")); 78 77 Parameters.Add(new FixedValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem."));
Note: See TracChangeset
for help on using the changeset viewer.