- Timestamp:
- 08/03/20 11:35:39 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/EvaluationResult.cs
r17381 r17709 35 35 [Storable] 36 36 private readonly Dictionary<string, object> data = new Dictionary<string, object>(); 37 public IEnumerable<KeyValuePair<string, object>> AdditionalData => data.AsEnumerable(); 37 38 38 39 protected EvaluationResult() : base() { } -
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IEvaluationResult.cs
r17459 r17709 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using HEAL.Attic; 23 24 using HeuristicLab.Core; … … 28 29 29 30 //TODO: make methods generic for get/set additional data 31 IEnumerable<KeyValuePair<string, object>> AdditionalData { get; } 30 32 void SetAdditionalData(string identifier, object o); 31 33 object GetAdditionalData(string identifier); -
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/ScopeUtil.cs
r17699 r17709 86 86 scope.Variables.Add(new Variable(EvaluationResultName, solutionContext.EvaluationResult)); 87 87 } else variable2.Value = solutionContext.EvaluationResult; 88 if (solutionContext.EvaluationResult != null) { 89 foreach (var item in solutionContext.EvaluationResult.AdditionalData) { 90 if (item.Value is IItem i) { 91 if (!scope.Variables.TryGetValue(item.Key, out var variable)) 92 scope.Variables.Add(new Variable(item.Key, i)); 93 else variable.Value = i; 94 } 95 } 96 } 88 97 } 89 98 } -
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/SingleObjectiveEvaluator.cs
r17699 r17709 69 69 ScopeUtil.CopyToScope(ExecutionContext.Scope, solutionContext); 70 70 QualityParameter.ActualValue = new DoubleValue(solutionContext.EvaluationResult.Quality); 71 72 71 return base.InstrumentedApply(); 73 72 }
Note: See TracChangeset
for help on using the changeset viewer.