- Timestamp:
- 07/23/20 16:21:55 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.ParameterOptimization/3.3/ParameterOptimizationProblem.cs
r17226 r17695 22 22 using System; 23 23 using System.Linq; 24 using HEAL.Attic; 24 25 using HeuristicLab.Analysis; 25 26 using HeuristicLab.Common; … … 30 31 using HeuristicLab.Optimization.Operators; 31 32 using HeuristicLab.Parameters; 32 using HEAL.Attic;33 33 using HeuristicLab.PluginInfrastructure; 34 34 … … 36 36 [Item("Parameter Optimization Problem", "A base class for other problems for the optimization of a parameter vector.")] 37 37 [StorableType("B1F529FE-483C-4EF2-9306-2F6A0833EEAC")] 38 public abstract class ParameterOptimizationProblem : SingleObjectiveHeuristicOptimizationProblem<IParameterVectorEvaluator , IRealVectorCreator>, IStorableContent {38 public abstract class ParameterOptimizationProblem : SingleObjectiveHeuristicOptimizationProblem<IParameterVectorEvaluator>, IStorableContent { 39 39 public string Filename { get; set; } 40 40 private const string ProblemSizeParameterName = "ProblemSize"; … … 94 94 95 95 protected ParameterOptimizationProblem(IParameterVectorEvaluator evaluator) 96 : base(evaluator , new UniformRandomRealVectorCreator()) {96 : base(evaluator) { 97 97 Parameters.Add(new FixedValueParameter<IntValue>(ProblemSizeParameterName, "The dimension of the parameter vector that is to be optimized.", new IntValue(1))); 98 98 Parameters.Add(new ValueParameter<DoubleMatrix>(BoundsParameterName, "The bounds for each dimension of the parameter vector. If the number of bounds is smaller than the problem size then the bounds are reused in a cyclic manner.", new DoubleMatrix(new double[,] { { 0, 100 } }, new string[] { "LowerBound", "UpperBound" }))); 99 99 Parameters.Add(new ValueParameter<StringArray>(ParameterNamesParameterName, "The element names which are used to calculate the quality of a parameter vector.", new StringArray(new string[] { "Parameter0" }))); 100 100 101 SolutionCreator.LengthParameter.ActualName = "ProblemSize"; 101 // TODO 102 //SolutionCreator.LengthParameter.ActualName = "ProblemSize"; 102 103 103 104 Operators.AddRange(ApplicationManager.Manager.GetInstances<IRealVectorOperator>()); … … 139 140 140 141 private void UpdateParameters() { 141 Evaluator.ParameterVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 142 // TODO: This method wired solution creator -> should be done by encoding 143 //Evaluator.ParameterVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 142 144 Evaluator.ParameterNamesParameter.ActualName = ParameterNamesParameter.Name; 143 145 144 146 foreach (var bestSolutionAnalyzer in Operators.OfType<BestSolutionAnalyzer>()) { 145 bestSolutionAnalyzer.ParameterVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;147 //bestSolutionAnalyzer.ParameterVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 146 148 bestSolutionAnalyzer.ParameterNamesParameter.ActualName = ParameterNamesParameter.Name; 147 149 } … … 152 154 Bounds[i, 1] = 100.0; 153 155 } 154 156 /* TODO 155 157 foreach (var op in Operators.OfType<IRealVectorManipulator>()) 156 158 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; … … 160 162 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 161 163 } 164 */ 162 165 } 163 166
Note: See TracChangeset
for help on using the changeset viewer.