Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/23/20 16:21:55 (4 years ago)
Author:
abeham
Message:

#2521:

  • Moving solution creator parameter from problems to algorithms (breaking wiring in some HeuristicOptimizationProblems)
  • Disallowing evaluator or encoding changes in encoding-specific base problems (to avoid confusion in derived problems whether this needs to be handled or not)
  • Added private set to ReferenceParameter property (serialization)
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  
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3232  [StorableType("E9876DF8-ACFA-41C8-93B7-FA40C57CE459")]
    33   public abstract class SymbolicDataAnalysisMultiObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, ISymbolicDataAnalysisMultiObjectiveProblem
     33  public abstract class SymbolicDataAnalysisMultiObjectiveProblem<T, U> : SymbolicDataAnalysisProblem<T, U>, ISymbolicDataAnalysisMultiObjectiveProblem
    3434    where T : class,IDataAnalysisProblemData
    35     where U : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<T>
    36     where V : class, ISymbolicDataAnalysisSolutionCreator {
     35    where U : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<T> {
    3736    private const string MaximizationParameterName = "Maximization";
    3837    private const string BestKnownQualityParameterName = "BestKnownQuality";
     
    5958    [StorableConstructor]
    6059    protected SymbolicDataAnalysisMultiObjectiveProblem(StorableConstructorFlag _) : base(_) { }
    61     protected SymbolicDataAnalysisMultiObjectiveProblem(SymbolicDataAnalysisMultiObjectiveProblem<T, U, V> original, Cloner cloner)
     60    protected SymbolicDataAnalysisMultiObjectiveProblem(SymbolicDataAnalysisMultiObjectiveProblem<T, U> original, Cloner cloner)
    6261      : base(original, cloner) {
    6362      RegisterEventHandler();
    6463    }
    6564
    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) {
    6867      Parameters.Add(new ValueParameter<BoolArray>(MaximizationParameterName, "Set to false if the problem should be minimized."));
    6968
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r17520 r17695  
    3737namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3838  [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,
    4040    IProblemInstanceConsumer<T>, IProblemInstanceExporter<T>
    4141    where T : class, IDataAnalysisProblemData
    42     where U : class, ISymbolicDataAnalysisEvaluator<T>
    43     where V : class, ISymbolicDataAnalysisSolutionCreator {
     42    where U : class, ISymbolicDataAnalysisEvaluator<T> {
    4443
    4544    #region parameter names & descriptions
     
    169168      RegisterEventHandlers();
    170169    }
    171     protected SymbolicDataAnalysisProblem(SymbolicDataAnalysisProblem<T, U, V> original, Cloner cloner)
     170    protected SymbolicDataAnalysisProblem(SymbolicDataAnalysisProblem<T, U> original, Cloner cloner)
    172171      : base(original, cloner) {
    173172      RegisterEventHandlers();
    174173    }
    175174
    176     protected SymbolicDataAnalysisProblem(T problemData, U evaluator, V solutionCreator)
    177       : base(evaluator, solutionCreator) {
     175    protected SymbolicDataAnalysisProblem(T problemData, U evaluator)
     176      : base(evaluator) {
    178177      Parameters.Add(new ValueParameter<T>(ProblemDataParameterName, ProblemDataParameterDescription, problemData));
    179178      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(SymbolicExpressionTreeGrammarParameterName, SymbolicExpressionTreeGrammarParameterDescription));
     
    268267    }
    269268
    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 
    280269    protected override void OnEvaluatorChanged() {
    281270      base.OnEvaluatorChanged();
     
    314303      foreach (var op in operators.OfType<ISymbolicDataAnalysisEvaluator<T>>()) {
    315304        op.ProblemDataParameter.ActualName = ProblemDataParameterName;
    316         op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     305        //op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    317306        op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
    318307        op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
     
    320309      }
    321310      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;
    324313      }
    325314      foreach (var op in operators.OfType<ISymbolicExpressionTreeManipulator>()) {
    326         op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     315        //op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    327316      }
    328317      foreach (var op in operators.OfType<ISymbolicExpressionTreeAnalyzer>()) {
    329         op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     318        //op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    330319      }
    331320      foreach (var op in operators.OfType<ISymbolicDataAnalysisSingleObjectiveAnalyzer>()) {
     
    336325      }
    337326      foreach (var op in operators.OfType<ISymbolicDataAnalysisAnalyzer>()) {
    338         op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     327        //op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    339328      }
    340329      foreach (var op in operators.OfType<ISymbolicDataAnalysisValidationAnalyzer<U, T>>()) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSingleObjectiveProblem.cs

    r17317 r17695  
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3232  [StorableType("BC7E7414-64B5-4428-AA89-270F8EF6E35E")]
    33   public abstract class SymbolicDataAnalysisSingleObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, ISymbolicDataAnalysisSingleObjectiveProblem
     33  public abstract class SymbolicDataAnalysisSingleObjectiveProblem<T, U> : SymbolicDataAnalysisProblem<T, U>, ISymbolicDataAnalysisSingleObjectiveProblem
    3434    where T : class,IDataAnalysisProblemData
    35     where U : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<T>
    36     where V : class, ISymbolicDataAnalysisSolutionCreator {
     35    where U : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<T> {
    3736    private const string MaximizationParameterName = "Maximization";
    3837    private const string BestKnownQualityParameterName = "BestKnownQuality";
     
    6766    [StorableConstructor]
    6867    protected SymbolicDataAnalysisSingleObjectiveProblem(StorableConstructorFlag _) : base(_) { }
    69     protected SymbolicDataAnalysisSingleObjectiveProblem(SymbolicDataAnalysisSingleObjectiveProblem<T, U, V> original, Cloner cloner)
     68    protected SymbolicDataAnalysisSingleObjectiveProblem(SymbolicDataAnalysisSingleObjectiveProblem<T, U> original, Cloner cloner)
    7069      : base(original, cloner) {
    7170      RegisterEventHandler();
     
    7372    }
    7473
    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) {
    7776      Parameters.Add(new FixedValueParameter<BoolValue>(MaximizationParameterName, "Set to false if the problem should be minimized."));
    7877      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.