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.Clients.OKB/3.3/RunCreation
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Clients.OKB/3.3/RunCreation/EmptyMultiObjectiveProblem.cs

    r17226 r17695  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
    25 using HEAL.Attic;
    2626using HeuristicLab.PluginInfrastructure;
    2727
     
    3030  [StorableType("1AD8A6B9-1B3E-40BA-BAE2-8EAD31793B7D")]
    3131  [NonDiscoverableType]
    32   public sealed class EmptyMultiObjectiveProblem : MultiObjectiveHeuristicOptimizationProblem<EmptyMultiObjectiveEvaluator, EmptySolutionCreator> {
     32  public sealed class EmptyMultiObjectiveProblem : MultiObjectiveHeuristicOptimizationProblem<EmptyMultiObjectiveEvaluator> {
    3333    public override bool CanChangeName {
    3434      get { return false; }
     
    4141    private EmptyMultiObjectiveProblem(StorableConstructorFlag _) : base(_) { }
    4242    private EmptyMultiObjectiveProblem(EmptyMultiObjectiveProblem original, Cloner cloner) : base(original, cloner) { }
    43     public EmptyMultiObjectiveProblem() : base(new EmptyMultiObjectiveEvaluator(), new EmptySolutionCreator()) { }
    44     public EmptyMultiObjectiveProblem(string exceptionMessage) : base(new EmptyMultiObjectiveEvaluator(exceptionMessage), new EmptySolutionCreator(exceptionMessage)) { }
     43    public EmptyMultiObjectiveProblem() : base(new EmptyMultiObjectiveEvaluator()) { }
     44    public EmptyMultiObjectiveProblem(string exceptionMessage) : base(new EmptyMultiObjectiveEvaluator(exceptionMessage)) { }
    4545
    4646    public override IDeepCloneable Clone(Cloner cloner) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Clients.OKB/3.3/RunCreation/EmptyProblem.cs

    r17226 r17695  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
    25 using HEAL.Attic;
    2626using HeuristicLab.PluginInfrastructure;
    2727
     
    3030  [StorableType("10132D57-7177-42A2-97B9-B77D89AADE6A")]
    3131  [NonDiscoverableType]
    32   public sealed class EmptyProblem : HeuristicOptimizationProblem<EmptyEvaluator, EmptySolutionCreator> {
     32  public sealed class EmptyProblem : HeuristicOptimizationProblem<EmptyEvaluator> {
    3333    public override bool CanChangeName {
    3434      get { return false; }
     
    4343    public EmptyProblem()
    4444      : base() {
    45       SolutionCreator = new EmptySolutionCreator();
    4645      Evaluator = new EmptyEvaluator();
    4746    }
    4847    public EmptyProblem(string exceptionMessage)
    4948      : base() {
    50       SolutionCreator = new EmptySolutionCreator(exceptionMessage);
    5149      Evaluator = new EmptyEvaluator(exceptionMessage);
    5250    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Clients.OKB/3.3/RunCreation/EmptySingleObjectiveProblem.cs

    r17226 r17695  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
    25 using HEAL.Attic;
    2626using HeuristicLab.PluginInfrastructure;
    2727
     
    3030  [StorableType("12D022A4-6DC4-4840-9EE7-F1EEB7A408F6")]
    3131  [NonDiscoverableType]
    32   public sealed class EmptySingleObjectiveProblem : SingleObjectiveHeuristicOptimizationProblem<EmptySingleObjectiveEvaluator, EmptySolutionCreator> {
     32  public sealed class EmptySingleObjectiveProblem : SingleObjectiveHeuristicOptimizationProblem<EmptySingleObjectiveEvaluator> {
    3333    public override bool CanChangeName {
    3434      get { return false; }
     
    4141    private EmptySingleObjectiveProblem(StorableConstructorFlag _) : base(_) { }
    4242    private EmptySingleObjectiveProblem(EmptySingleObjectiveProblem original, Cloner cloner) : base(original, cloner) { }
    43     public EmptySingleObjectiveProblem() : base(new EmptySingleObjectiveEvaluator(), new EmptySolutionCreator()) { }
    44     public EmptySingleObjectiveProblem(string exceptionMessage) : base(new EmptySingleObjectiveEvaluator(exceptionMessage), new EmptySolutionCreator(exceptionMessage)) { }
     43    public EmptySingleObjectiveProblem() : base(new EmptySingleObjectiveEvaluator()) { }
     44    public EmptySingleObjectiveProblem(string exceptionMessage) : base(new EmptySingleObjectiveEvaluator(exceptionMessage)) { }
    4545
    4646    public override IDeepCloneable Clone(Cloner cloner) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Clients.OKB/3.3/RunCreation/OKBProblem.cs

    r17612 r17695  
    6161            OnDescriptionChanged();
    6262            OnProblemChanged();
    63             OnSolutionCreatorChanged();
    6463            OnEvaluatorChanged();
    6564            OnOperatorsChanged();
     
    105104    public IKeyedItemCollection<string, IParameter> Parameters {
    106105      get { return Problem.Parameters; }
    107     }
    108 
    109     public IParameter SolutionCreatorParameter {
    110       get { return Problem.SolutionCreatorParameter; }
    111     }
    112     public ISolutionCreator SolutionCreator {
    113       get { return Problem.SolutionCreator; }
    114106    }
    115107    public IParameter EvaluatorParameter {
     
    210202      if (handler != null) handler(this, EventArgs.Empty);
    211203    }
    212     public event EventHandler SolutionCreatorChanged;
    213     protected virtual void OnSolutionCreatorChanged() {
    214       var handler = SolutionCreatorChanged;
    215       if (handler != null) handler(this, EventArgs.Empty);
    216     }
    217204    public event EventHandler EvaluatorChanged;
    218205    protected virtual void OnEvaluatorChanged() {
     
    238225        Problem.NameChanged += new EventHandler(Problem_NameChanged);
    239226        Problem.DescriptionChanged += new EventHandler(Problem_DescriptionChanged);
    240         Problem.SolutionCreatorChanged += new EventHandler(Problem_SolutionCreatorChanged);
    241227        Problem.EvaluatorChanged += new EventHandler(Problem_EvaluatorChanged);
    242228        Problem.OperatorsChanged += new EventHandler(Problem_OperatorsChanged);
     
    251237        Problem.NameChanged -= new EventHandler(Problem_NameChanged);
    252238        Problem.DescriptionChanged -= new EventHandler(Problem_DescriptionChanged);
    253         Problem.SolutionCreatorChanged -= new EventHandler(Problem_SolutionCreatorChanged);
    254239        Problem.EvaluatorChanged -= new EventHandler(Problem_EvaluatorChanged);
    255240        Problem.OperatorsChanged -= new EventHandler(Problem_OperatorsChanged);
     
    273258      OnDescriptionChanged();
    274259    }
    275     private void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
    276       OnSolutionCreatorChanged();
    277     }
    278260    private void Problem_EvaluatorChanged(object sender, EventArgs e) {
    279261      OnEvaluatorChanged();
Note: See TracChangeset for help on using the changeset viewer.