Changeset 16806 for branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiObjectiveProblem.cs
- Timestamp:
- 04/17/19 23:06:18 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiObjectiveProblem.cs
r16801 r16806 36 36 where TEncodedSolution : class, IEncodedSolution { 37 37 38 protected IValueParameter<BoolArray> MaximizationParameter { 39 get { return (IValueParameter<BoolArray>)Parameters["Maximization"]; } 40 } 41 38 42 [StorableConstructor] 39 43 protected MultiObjectiveProblem(StorableConstructorFlag _) : base(_) { } … … 44 48 } 45 49 46 protected MultiObjectiveProblem() 47 : base() { 50 protected MultiObjectiveProblem() : base() { 51 Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly())); 52 53 Operators.Add(Evaluator); 54 Operators.Add(new MultiObjectiveAnalyzer<TEncodedSolution>()); 55 56 ParameterizeOperators(); 57 } 58 59 protected MultiObjectiveProblem(TEncoding encoding) : base(encoding) { 48 60 Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly())); 49 61 … … 59 71 } 60 72 73 public int Objectives => Maximization.Length; 61 74 public abstract bool[] Maximization { get; } 62 public abstract double[] Evaluate(TEncodedSolution individual, IRandom random);63 public virtual void Analyze(TEncodedSolution[] individuals, double[][] qualities, ResultCollection results, IRandom random) { }75 public abstract double[] Evaluate(TEncodedSolution solution, IRandom random); 76 public virtual void Analyze(TEncodedSolution[] solutions, double[][] qualities, ResultCollection results, IRandom random) { } 64 77 65 78 protected override void OnOperatorsChanged() {
Note: See TracChangeset
for help on using the changeset viewer.