Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/27/20 18:12:39 (5 years ago)
Author:
abeham
Message:

#2521 WIP refactoring:

  1. Introduce nicer type IResultDefinition for API users to avoid complex IParameter interface (hide ActualValue)
  2. Change result parameter to contexts (need quality and solution): only implemented for BinaryVectorProblem
Location:
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/Results
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/Results/IResultParameter.cs

    r17517 r17522  
    2121
    2222using System;
     23using HEAL.Attic;
    2324using HeuristicLab.Core;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Optimization {
     27  [StorableType("986fa3d0-38f8-43aa-820e-e67d09a29025")]
     28  public interface IResultDefinition {
     29    string Name { get; set; }
     30  }
     31
     32  [StorableType("4c0c854b-676d-4ccd-96c4-b06a3d7f2fa1")]
     33  public interface IResultDefinition<T> : IResultDefinition where T : class, IItem {
     34    T Get(ResultCollection results);
     35  }
     36
    2737  [StorableType("af5d3f60-6f3a-4a44-a906-688ac8296fe3")]
    28   public interface IResultParameter : ILookupParameter {
     38  public interface IResultParameter : ILookupParameter, IResultDefinition {
    2939    string ResultCollectionName { get; set; }
    3040    ResultCollection ResultCollection { get; set; }
     
    3444
    3545  [StorableType("803e6ad6-dd9d-497a-ad1c-7cd3dc5b0d3c")]
    36   public interface IResultParameter<T> : ILookupParameter<T>, IResultParameter where T : class, IItem {
     46  public interface IResultParameter<T> : ILookupParameter<T>, IResultParameter, IResultDefinition<T> where T : class, IItem {
    3747    T DefaultValue { get; set; }
    3848    event EventHandler DefaultValueChanged;
  • branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/Results/ResultParameter.cs

    r17517 r17522  
    6262    [Storable]
    6363    public ResultCollection ResultCollection { get; set; }
     64
     65    string IResultDefinition.Name { get => ActualName; set => ActualName = value; }
     66    T IResultDefinition<T>.Get(ResultCollection results) => results[ActualName].Value as T;
    6467
    6568    [StorableConstructor]
Note: See TracChangeset for help on using the changeset viewer.