- Timestamp:
- 09/15/20 13:53:11 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISingleObjectiveProblemDefinition.cs
r17699 r17745 43 43 void Evaluate(ISingleObjectiveSolutionContext<TEncodedSolution> solutionContext, IRandom random, CancellationToken cancellationToken); 44 44 45 //TODO add cancellation token?46 void Analyze(ISingleObjectiveSolutionContext<TEncodedSolution>[] solutionContexts, ResultCollection results,IRandom random);45 //TODO add cancellation token? 46 void Analyze(ISingleObjectiveSolutionContext<TEncodedSolution>[] solutionContexts, IRandom random); 47 47 48 48 //TODO remove neighbors from ProblemDefinition? -
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/internal/ISingleObjectiveAnalysisOperator.cs
r17699 r17745 28 28 internal interface ISingleObjectiveAnalysisOperator<TEncodedSolution> : IEncodingOperator, ISingleObjectiveOperator 29 29 where TEncodedSolution : class, IEncodedSolution { 30 Action<ISingleObjectiveSolutionContext<TEncodedSolution>[], ResultCollection,IRandom> Analyze { get; set; }30 Action<ISingleObjectiveSolutionContext<TEncodedSolution>[], IRandom> Analyze { get; set; } 31 31 } 32 32 } -
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Operators/SingleObjectiveAnalyzer.cs
r17699 r17745 53 53 } 54 54 55 public Action<ISingleObjectiveSolutionContext<TEncodedSolution>[], ResultCollection,IRandom> Analyze { get; set; }55 public Action<ISingleObjectiveSolutionContext<TEncodedSolution>[], IRandom> Analyze { get; set; } 56 56 57 57 [StorableConstructor] … … 82 82 }).ToArray(); 83 83 84 Analyze(solutionContexts, r esults, random);84 Analyze(solutionContexts, random); 85 85 foreach (var s in solutionContexts.Zip(scopes, Tuple.Create)) { 86 86 ScopeUtil.CopyToScope(s.Item2, s.Item1); -
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveProblem.cs
r17699 r17745 110 110 } 111 111 112 public virtual void Analyze(TEncodedSolution[] solutions, double[] qualities, ResultCollection results, IRandom random) { } 113 public virtual void Analyze(ISingleObjectiveSolutionContext<TEncodedSolution>[] solutionContexts, ResultCollection results, IRandom random) { 114 var solutions = solutionContexts.Select(c => c.EncodedSolution).ToArray(); 115 var qualities = solutionContexts.Select(c => c.EvaluationResult.Quality).ToArray(); 116 Analyze(solutions, qualities, results, random); 117 } 112 public virtual void Analyze(ISingleObjectiveSolutionContext<TEncodedSolution>[] solutionContexts, IRandom random) { } 118 113 119 114 public virtual IEnumerable<TEncodedSolution> GetNeighbors(TEncodedSolution solutions, IRandom random) { -
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/SolutionContext.cs
r17577 r17745 85 85 public SingleObjectiveSolutionContext(TEncodedSolution encodedSolution) : base(encodedSolution) { } 86 86 87 88 public SingleObjectiveSolutionContext(TEncodedSolution encodedSolution, IEvaluationResult evaluationResult) : base(encodedSolution, evaluationResult) { } 87 public SingleObjectiveSolutionContext(TEncodedSolution encodedSolution, ISingleObjectiveEvaluationResult evaluationResult) : base(encodedSolution, evaluationResult) { } 89 88 90 89 [StorableConstructor] … … 110 109 111 110 112 public MultiObjectiveSolutionContext(TEncodedSolution encodedSolution, I EvaluationResult evaluationResult) : base(encodedSolution, evaluationResult) { }111 public MultiObjectiveSolutionContext(TEncodedSolution encodedSolution, IMultiObjectiveEvaluationResult evaluationResult) : base(encodedSolution, evaluationResult) { } 113 112 114 113 [StorableConstructor]
Note: See TracChangeset
for help on using the changeset viewer.