Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/23/20 16:21:55 (4 years ago)
Author:
abeham
Message:

#2521:

  • Moving solution creator parameter from problems to algorithms (breaking wiring in some HeuristicOptimizationProblems)
  • Disallowing evaluator or encoding changes in encoding-specific base problems (to avoid confusion in derived problems whether this needs to be handled or not)
  • Added private set to ReferenceParameter property (serialization)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.ParameterOptimization/3.3/ParameterOptimizationProblem.cs

    r17226 r17695  
    2222using System;
    2323using System.Linq;
     24using HEAL.Attic;
    2425using HeuristicLab.Analysis;
    2526using HeuristicLab.Common;
     
    3031using HeuristicLab.Optimization.Operators;
    3132using HeuristicLab.Parameters;
    32 using HEAL.Attic;
    3333using HeuristicLab.PluginInfrastructure;
    3434
     
    3636  [Item("Parameter Optimization Problem", "A base class for other problems for the optimization of a parameter vector.")]
    3737  [StorableType("B1F529FE-483C-4EF2-9306-2F6A0833EEAC")]
    38   public abstract class ParameterOptimizationProblem : SingleObjectiveHeuristicOptimizationProblem<IParameterVectorEvaluator, IRealVectorCreator>, IStorableContent {
     38  public abstract class ParameterOptimizationProblem : SingleObjectiveHeuristicOptimizationProblem<IParameterVectorEvaluator>, IStorableContent {
    3939    public string Filename { get; set; }
    4040    private const string ProblemSizeParameterName = "ProblemSize";
     
    9494
    9595    protected ParameterOptimizationProblem(IParameterVectorEvaluator evaluator)
    96       : base(evaluator, new UniformRandomRealVectorCreator()) {
     96      : base(evaluator) {
    9797      Parameters.Add(new FixedValueParameter<IntValue>(ProblemSizeParameterName, "The dimension of the parameter vector that is to be optimized.", new IntValue(1)));
    9898      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" })));
    9999      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" })));
    100100
    101       SolutionCreator.LengthParameter.ActualName = "ProblemSize";
     101      // TODO
     102      //SolutionCreator.LengthParameter.ActualName = "ProblemSize";
    102103
    103104      Operators.AddRange(ApplicationManager.Manager.GetInstances<IRealVectorOperator>());
     
    139140
    140141    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;
    142144      Evaluator.ParameterNamesParameter.ActualName = ParameterNamesParameter.Name;
    143145
    144146      foreach (var bestSolutionAnalyzer in Operators.OfType<BestSolutionAnalyzer>()) {
    145         bestSolutionAnalyzer.ParameterVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
     147        //bestSolutionAnalyzer.ParameterVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    146148        bestSolutionAnalyzer.ParameterNamesParameter.ActualName = ParameterNamesParameter.Name;
    147149      }
     
    152154        Bounds[i, 1] = 100.0;
    153155      }
    154 
     156      /* TODO
    155157      foreach (var op in Operators.OfType<IRealVectorManipulator>())
    156158        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
     
    160162        similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName;
    161163      }
     164      */
    162165    }
    163166
Note: See TracChangeset for help on using the changeset viewer.