Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/18/10 00:53:15 (14 years ago)
Author:
cneumuel
Message:

#1215 worked on metaoptimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Analyzers/BestQualityAnalyzer.cs

    r4516 r4830  
    99using HeuristicLab.Parameters;
    1010using HeuristicLab.Data;
     11using HeuristicLab.Common;
    1112
    1213namespace HeuristicLab.Problems.MetaOptimization {
     
    1617  [Item("BestQualityAnalyzer", "TODO An operator for analyzing the best solution of Traveling Salesman Problems given in path representation using city coordinates.")]
    1718  [StorableClass]
    18   public sealed class BestQualityAnalyzer : SingleSuccessorOperator, IAnalyzer {
     19  public sealed class BestParameterConfigurationAnalyzer : SingleSuccessorOperator, IAnalyzer {
     20    // Wagner: Spezielle View für die Lösungen (ParameterConfigurations): So wie bei Runs: die zu Optimierenden Parameter(-werte) der besten solution anzeigen
    1921
    20     public ScopeTreeLookupParameter<IParameterSet> ParameterSetParameter {
    21       get { return (ScopeTreeLookupParameter<IParameterSet>)Parameters["ParameterSet"]; }
     22    public ScopeTreeLookupParameter<IParameterConfiguration> ParameterVectorParameter {
     23      get { return (ScopeTreeLookupParameter<IParameterConfiguration>)Parameters["ParameterConfiguration"]; }
    2224    }
    2325    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
    2426      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
    2527    }
    26     public LookupParameter<IParameterSet> BestSolutionParameter {
    27       get { return (LookupParameter<IParameterSet>)Parameters["BestSolution"]; }
     28    public LookupParameter<IParameterConfiguration> BestSolutionParameter {
     29      get { return (LookupParameter<IParameterConfiguration>)Parameters["BestSolution"]; }
    2830    }
    2931    public ValueLookupParameter<ResultCollection> ResultsParameter {
     
    3335      get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
    3436    }
    35     public LookupParameter<IParameterSet> BestKnownSolutionParameter {
    36       get { return (LookupParameter<IParameterSet>)Parameters["BestKnownSolution"]; }
     37    public LookupParameter<IParameterConfiguration> BestKnownSolutionParameter {
     38      get { return (LookupParameter<IParameterConfiguration>)Parameters["BestKnownSolution"]; }
    3739    }
    3840
    39     public BestQualityAnalyzer()
     41    public BestParameterConfigurationAnalyzer()
    4042      : base() {
    41       Parameters.Add(new ScopeTreeLookupParameter<IParameterSet>("ParameterSet", "TODO The TSP solutions given in path representation from which the best solution should be analyzed."));
     43      Parameters.Add(new ScopeTreeLookupParameter<IParameterConfiguration>("ParameterConfiguration", "TODO The TSP solutions given in path representation from which the best solution should be analyzed."));
    4244      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "TODO The qualities of the TSP solutions which should be analyzed."));
    43       Parameters.Add(new LookupParameter<IParameterSet>("BestSolution", "TODO The best TSP solution."));
     45      Parameters.Add(new LookupParameter<IParameterConfiguration>("BestSolution", "TODO The best TSP solution."));
    4446      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "TODO The result collection where the best TSP solution should be stored."));
    4547      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "TODO The quality of the best known solution of this TSP instance."));
    46       Parameters.Add(new LookupParameter<IParameterSet>("BestKnownSolution", "TODO The best known solution of this TSP instance."));
     48      Parameters.Add(new LookupParameter<IParameterConfiguration>("BestKnownSolution", "TODO The best known solution of this TSP instance."));
     49    }
     50
     51    [StorableConstructor]
     52    private BestParameterConfigurationAnalyzer(bool deserializing) : base(deserializing) { }
     53    private BestParameterConfigurationAnalyzer(BestParameterConfigurationAnalyzer original, Cloner cloner) : base(original, cloner) { }
     54    public override IDeepCloneable Clone(Cloner cloner) {
     55      return new BestParameterConfigurationAnalyzer(this, cloner);
    4756    }
    4857
     
    5160      ResultCollection results = ResultsParameter.ActualValue;
    5261      DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue;
    53       ItemArray<IParameterSet> parameterSets = ParameterSetParameter.ActualValue;
     62      ItemArray<IParameterConfiguration> parameterVectors = ParameterVectorParameter.ActualValue;
    5463
    5564      int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
     
    5766      if (bestKnownQuality == null || qualities[i].Value < bestKnownQuality.Value) {
    5867        BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value);
    59         BestKnownSolutionParameter.ActualValue = (IParameterSet)parameterSets[i].Clone();
     68        BestKnownSolutionParameter.ActualValue = (IParameterConfiguration)parameterVectors[i].Clone();
    6069      }
    6170
Note: See TracChangeset for help on using the changeset viewer.