Changeset 17381 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/Templates
- Timestamp:
- 12/18/19 15:06:18 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/Templates/SingleObjectiveProblem_Template.cs
r17366 r17381 21 21 } 22 22 23 //TODO add other methods 24 25 public override void Evaluate(ISingleObjectiveSolutionContext<SOLUTION_CLASS> solutionContext, IRandom random, CancellationToken cancellationToken) { 26 var quality = Evaluate(solutionContext.EncodedSolution, random, cancellationToken); 27 var evaluationResult = new SingleObjectiveEvaluationResult(quality); 28 solutionContext.EvaluationResult = evaluationResult; 29 } 30 23 31 public override double Evaluate(SOLUTION_CLASS solution, IRandom random, CancellationToken cancellationToken) { 24 32 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 25 33 var quality = 0.0; 26 34 return quality; 35 } 36 37 public override void Analyze(ISingleObjectiveSolutionContext<TEncodedSolution>[] solutionContexts, ResultCollection results, IRandom random) { 38 var solutions = solutionContexts.Select(c => c.EncodedSolution).ToArray(); 39 var qualities = solutionContexts.Select(c => c.EvaluationResult.Quality).ToArray(); 40 Analyze(solutions, qualities, results, random); 27 41 } 28 42
Note: See TracChangeset
for help on using the changeset viewer.