- Timestamp:
- 10/04/19 14:23:08 (5 years ago)
- 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 23 23 using System.Collections.Generic; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Data; 25 26 using HeuristicLab.Optimization; 26 27 … … 77 78 78 79 #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; } 81 82 public abstract IReadOnlyList<double[]> BestKnownFront { get; } 82 83 public abstract double[] ReferencePoint { get; } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinitionScript.cs
r17309 r17315 24 24 using HeuristicLab.Common; 25 25 using HeuristicLab.Core; 26 using HeuristicLab.Data; 26 27 using HeuristicLab.Optimization; 27 28 … … 51 52 public IReadOnlyList<double[]> BestKnownFront => CompiledProblemDefinition.BestKnownFront; 52 53 public double[] ReferencePoint => CompiledProblemDefinition.ReferencePoint; 53 public IReadOnlyList<bool>Maximization => CompiledProblemDefinition.Maximization;54 public bool[] Maximization => CompiledProblemDefinition.Maximization; 54 55 55 56 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProgrammableProblem.cs
r17309 r17315 94 94 95 95 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}); 97 98 Encoding = (TEncoding)ProblemScript.Encoding.Clone(); 98 99 … … 106 107 private void OnProblemScriptNameChanged() { 107 108 Name = ProblemScript.Name; 109 } 110 111 public override bool[] Maximization { 112 get { return Parameters.ContainsKey("ProblemScript") ? ProblemDefinition.Maximization : new[] {false}; } 108 113 } 109 114 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/Templates/MultiObjectiveCombinedEncodingProblem_Template.cs
r17309 r17315 16 16 namespace HeuristicLab.Problems.Programmable { 17 17 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 }; } } 19 19 public override double[] ReferencePoint { get { return null; } } 20 20 public override IReadOnlyList<double[]> BestKnownFront { get { return null; } }
Note: See TracChangeset
for help on using the changeset viewer.