Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/04/19 14:23:08 (5 years ago)
Author:
abeham
Message:

#2521: reverted r17309

Location:
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/CompiledProblemDefinition.cs

    r17309 r17315  
    2323using System.Collections.Generic;
    2424using HeuristicLab.Core;
     25using HeuristicLab.Data;
    2526using HeuristicLab.Optimization;
    2627
     
    7778
    7879    #region ISingleObjectiveProblemDefinition<TEncoding,TEncodedSolution> Members
    79     public int Objectives => Maximization.Count;
    80     public abstract IReadOnlyList<bool> Maximization { get; }
     80    public int Objectives => Maximization.Length;
     81    public abstract bool[] Maximization { get; }
    8182    public abstract IReadOnlyList<double[]> BestKnownFront { get; }
    8283    public abstract double[] ReferencePoint { get; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinitionScript.cs

    r17309 r17315  
    2424using HeuristicLab.Common;
    2525using HeuristicLab.Core;
     26using HeuristicLab.Data;
    2627using HeuristicLab.Optimization;
    2728
     
    5152    public IReadOnlyList<double[]> BestKnownFront => CompiledProblemDefinition.BestKnownFront;
    5253    public double[] ReferencePoint => CompiledProblemDefinition.ReferencePoint;
    53     public IReadOnlyList<bool> Maximization => CompiledProblemDefinition.Maximization;
     54    public bool[] Maximization => CompiledProblemDefinition.Maximization;
    5455
    5556
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs

    r17309 r17315  
    9494
    9595    private void OnProblemDefinitionChanged() {
    96       Maximization = new BoolArray(ProblemDefinition.Maximization);
     96      Parameters.Remove("Maximization");
     97      Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly()) {Hidden = true});
    9798      Encoding = (TEncoding)ProblemScript.Encoding.Clone();
    9899
     
    106107    private void OnProblemScriptNameChanged() {
    107108      Name = ProblemScript.Name;
     109    }
     110
     111    public override bool[] Maximization {
     112      get { return Parameters.ContainsKey("ProblemScript") ? ProblemDefinition.Maximization : new[] {false}; }
    108113    }
    109114
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/Templates/MultiObjectiveCombinedEncodingProblem_Template.cs

    r17309 r17315  
    1616namespace HeuristicLab.Problems.Programmable {
    1717  public class CompiledMultiObjectiveProblemDefinition : CompiledMultiObjectiveProblemDefinition<CombinedEncoding, CombinedSolution> {
    18     public override IReadOnlyList<bool> Maximization { get { return new[] { true, false }; } }
     18    public override bool[] Maximization { get { return new[] { true, false }; } }
    1919    public override double[] ReferencePoint { get { return null; } }
    2020    public override IReadOnlyList<double[]> BestKnownFront { get { return null; } }
Note: See TracChangeset for help on using the changeset viewer.