Changeset 6473 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators
- Timestamp:
- 06/22/11 18:36:20 (14 years ago)
- 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 55 55 56 56 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 57 60 ItemDictionary<StringValue, RunCollection> solutionCache = ResultsParameter.ActualValue.ContainsKey("SolutionCache") ? (ItemDictionary<StringValue, RunCollection>)ResultsParameter.ActualValue["SolutionCache"].Value : null; 58 61 ParameterConfigurationTree parameterConfiguration = ParameterConfigurationParameter.ActualValue; -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Evaluators/AlgorithmRunsAnalyzer.cs
r6197 r6473 63 63 public LookupParameter<DoubleValue> EvaluatedSolutionsWeightParameter { 64 64 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; } 65 71 } 66 72 #endregion … … 87 93 Parameters.Add(new LookupParameter<DoubleValue>(MetaOptimizationProblem.StandardDeviationWeightParameterName)); 88 94 Parameters.Add(new LookupParameter<DoubleValue>(MetaOptimizationProblem.EvaluatedSolutionsWeightParameterName)); 95 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope whose sub-scopes represent the parents.")); 89 96 } 90 97 protected AlgorithmRunsAnalyzer(AlgorithmRunsAnalyzer original, Cloner cloner) … … 93 100 public override IDeepCloneable Clone(Cloner cloner) { 94 101 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 95 106 } 96 107 … … 173 184 else 174 185 penaltyValue = results.ContainsKey("CurrentWorstQuality") ? ((DoubleValue)results["CurrentWorstQuality"].Value).Value : referenceQualityAverages.Max(); 175 186 176 187 this.QualityParameter.ActualValue = new DoubleValue(penaltyValue); 177 188 parameterConfiguration.Quality = new DoubleValue(penaltyValue); … … 188 199 } 189 200 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 190 204 return base.Apply(); 191 205 }
Note: See TracChangeset
for help on using the changeset viewer.