Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/ISolutionContext.cs @ 17383

Last change on this file since 17383 was 17382, checked in by mkommend, 5 years ago

#2521: Refactored single-objective problems to use EvaluationResult instead of double as return type from Evaluate.

File size: 2.1 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using HEAL.Attic;
23using HeuristicLab.Core;
24
25namespace HeuristicLab.Optimization {
26  //TODO discuss renaming to solution scope?
27  [StorableType("383A35EB-03C9-473D-A20B-EE34E00BC174")]
28  public interface ISolutionContext : IItem {
29
30    bool IsEvaluated { get; }
31    IEncodedSolution EncodedSolution { get; }
32
33    IEvaluationResult EvaluationResult { get; }
34
35
36    //TODO: make methods generic for get/set additional data
37    void SetAdditionalData(string identifier, object o);
38    object GetAdditionalData(string identifier);
39  }
40
41  public interface ISolutionContext<TEncodedSolution> : ISolutionContext
42    where TEncodedSolution : class, IEncodedSolution {
43    new TEncodedSolution EncodedSolution { get; }
44  }
45
46
47  public interface ISingleObjectiveSolutionContext<TEncodedSolution> : ISolutionContext<TEncodedSolution>
48    where TEncodedSolution : class, IEncodedSolution {
49    //TODO discuss with abeham hiding of base property
50    new ISingleObjectiveEvaluationResult EvaluationResult { get; set; }
51  }
52
53  public interface IMultiObjectiveSolutionContext<TEncodedSolution> : ISolutionContext<TEncodedSolution>
54    where TEncodedSolution : class, IEncodedSolution {
55    new IMultiObjectiveEvaluationResult EvaluationResult { get; set; }
56  }
57
58}
Note: See TracBrowser for help on using the repository browser.