Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/22/11 18:36:20 (14 years ago)
Author:
cneumuel
Message:

#1215

  • adaptions for OSGA
Location:
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/AlgorithmEvaluator.cs

    r6090 r6473  
    5555
    5656    public override IOperation Apply() {
     57      bool isValidScope = RepetitionIndexParameter.ActualValue != null; // this is a workaround for OSGA, where the PMOEvaluator is executed on scopes which happen to contain additional subscopes which collide with the subscopes created for the repetitions/problems in PMOEvaluator
     58      if (!isValidScope) return base.Apply();
     59
    5760      ItemDictionary<StringValue, RunCollection> solutionCache = ResultsParameter.ActualValue.ContainsKey("SolutionCache") ? (ItemDictionary<StringValue, RunCollection>)ResultsParameter.ActualValue["SolutionCache"].Value : null;
    5861      ParameterConfigurationTree parameterConfiguration = ParameterConfigurationParameter.ActualValue;
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/AlgorithmRunsAnalyzer.cs

    r6197 r6473  
    6363    public LookupParameter<DoubleValue> EvaluatedSolutionsWeightParameter {
    6464      get { return (LookupParameter<DoubleValue>)Parameters[MetaOptimizationProblem.EvaluatedSolutionsWeightParameterName]; }
     65    }
     66    private ScopeParameter CurrentScopeParameter {
     67      get { return (ScopeParameter)Parameters["CurrentScope"]; }
     68    }
     69    public IScope CurrentScope {
     70      get { return CurrentScopeParameter.ActualValue; }
    6571    }
    6672    #endregion
     
    8793      Parameters.Add(new LookupParameter<DoubleValue>(MetaOptimizationProblem.StandardDeviationWeightParameterName));
    8894      Parameters.Add(new LookupParameter<DoubleValue>(MetaOptimizationProblem.EvaluatedSolutionsWeightParameterName));
     95      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope whose sub-scopes represent the parents."));
    8996    }
    9097    protected AlgorithmRunsAnalyzer(AlgorithmRunsAnalyzer original, Cloner cloner)
     
    93100    public override IDeepCloneable Clone(Cloner cloner) {
    94101      return new AlgorithmRunsAnalyzer(this, cloner);
     102    }
     103    [StorableHook(HookType.AfterDeserialization)]
     104    private void AfterDeserialization() {
     105      if (!Parameters.ContainsKey("CurrentScope")) Parameters.Add(new ScopeParameter("CurrentScope", "The current scope whose sub-scopes represent the parents.")); // backwards compatibility
    95106    }
    96107
     
    173184        else
    174185          penaltyValue = results.ContainsKey("CurrentWorstQuality") ? ((DoubleValue)results["CurrentWorstQuality"].Value).Value : referenceQualityAverages.Max();
    175        
     186
    176187        this.QualityParameter.ActualValue = new DoubleValue(penaltyValue);
    177188        parameterConfiguration.Quality = new DoubleValue(penaltyValue);
     
    188199      }
    189200
     201      // in OSGA there are more subscopes, so be careful which to delete
     202      CurrentScope.SubScopes.RemoveAll(x => x.Variables.Count((v) => (v.Name == "RepetitionCount")) == 1);
     203     
    190204      return base.Apply();
    191205    }
Note: See TracChangeset for help on using the changeset viewer.