- Timestamp:
- 06/19/20 14:26:41 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/MultiObjectiveProblem.cs
r17567 r17610 38 38 where TEncoding : class, IEncoding<TEncodedSolution> 39 39 where TEncodedSolution : class, IEncodedSolution { 40 #region Parameter names40 #region Parameter names 41 41 public const string BestKnownFrontParameterName = "BestKnownFront"; 42 42 public const string ReferencePointParameterName = "ReferencePoint"; 43 43 #endregion 44 44 45 #region Parameter properties45 #region Parameter properties 46 46 [Storable] public IValueParameter<BoolArray> MaximizationParameter { get; } 47 47 public IValueParameter<DoubleMatrix> BestKnownFrontParameter { … … 63 63 } 64 64 65 protected MultiObjectiveProblem() : base() {66 MaximizationParameter = new ValueParameter<BoolArray>("Maximization", "The dimensions correspond to the different objectives: False if the objective should be minimized, true if it should be maximized..", new BoolArray(new bool[] { }, @readonly: true));67 Parameters.Add(MaximizationParameter);68 Parameters.Add(new OptionalValueParameter<DoubleMatrix>(BestKnownFrontParameterName, "A double matrix representing the best known qualites for this problem (aka points on the Pareto front). Points are to be given in a row-wise fashion."));69 Parameters.Add(new OptionalValueParameter<DoubleArray>(ReferencePointParameterName, "The refrence point for hypervolume calculations on this problem"));70 Operators.Add(Evaluator);71 Operators.Add(new MultiObjectiveAnalyzer<TEncodedSolution>());72 ParameterizeOperators();73 }74 75 65 protected MultiObjectiveProblem(TEncoding encoding) : base(encoding) { 76 66 MaximizationParameter = new ValueParameter<BoolArray>("Maximization", "The dimensions correspond to the different objectives: False if the objective should be minimized, true if it should be maximized..", new BoolArray(new bool[] { }, @readonly: true)); 77 67 Parameters.Add(MaximizationParameter); 78 68 Parameters.Add(new OptionalValueParameter<DoubleMatrix>(BestKnownFrontParameterName, "A double matrix representing the best known qualites for this problem (aka points on the Pareto front). Points are to be given in a row-wise fashion.")); 79 Parameters.Add(new OptionalValueParameter<DoubleArray>(ReferencePointParameterName, "The ref rence point for hypervolume calculations on this problem"));69 Parameters.Add(new OptionalValueParameter<DoubleArray>(ReferencePointParameterName, "The reference point for hypervolume calculations on this problem")); 80 70 Operators.Add(Evaluator); 81 71 Operators.Add(new MultiObjectiveAnalyzer<TEncodedSolution>()); -
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs
r17570 r17610 101 101 } 102 102 103 protected Problem() 104 : base() { 105 Parameters.Add(new ValueParameter<TEncoding>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any.") { Hidden = true }); 106 Parameters.Add(new ValueParameter<TEvaluator>("Evaluator", "The operator used to evaluate a solution.") { Hidden = true }); 107 108 if (Encoding != null) { 109 oldEncoding = Encoding; 110 Parameterize(); 111 } 112 RegisterEvents(); 113 } 114 protected Problem(TEncoding encoding) { 103 protected Problem(TEncoding encoding) : base() { 115 104 if (encoding == null) throw new ArgumentNullException("encoding"); 116 105 Parameters.Add(new ValueParameter<TEncoding>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any.", encoding) { Hidden = true }); -
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveProblem.cs
r17570 r17610 72 72 BestKnownQualityParameter = cloner.Clone(original.BestKnownQualityParameter); 73 73 MaximizationParameter = cloner.Clone(original.MaximizationParameter); 74 Parameterize();75 RegisterEventHandlers();76 }77 78 protected SingleObjectiveProblem() : base() {79 MaximizationParameter = new ValueParameter<BoolValue>("Maximization", "Whether the problem should be maximized (True) or minimized (False).", new BoolValue(false).AsReadOnly()) { Hidden = true, ReadOnly = true };80 BestKnownQualityParameter = new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this problem.");81 82 Parameters.Add(MaximizationParameter);83 Parameters.Add(BestKnownQualityParameter);84 85 Operators.Add(Evaluator);86 Operators.Add(new SingleObjectiveAnalyzer<TEncodedSolution>());87 Operators.Add(new SingleObjectiveImprover<TEncodedSolution>());88 Operators.Add(new SingleObjectiveMoveEvaluator<TEncodedSolution>());89 Operators.Add(new SingleObjectiveMoveGenerator<TEncodedSolution>());90 Operators.Add(new SingleObjectiveMoveMaker<TEncodedSolution>());91 92 74 Parameterize(); 93 75 RegisterEventHandlers();
Note: See TracChangeset
for help on using the changeset viewer.