Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/08/20 16:55:51 (4 years ago)
Author:
abeham
Message:

#2521: Unified architecture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/OrienteeringSolution.cs

    r17526 r17533  
    3131
    3232namespace HeuristicLab.Problems.Orienteering {
     33  public interface IOrienteeringSolution : ITSPSolution {
     34    new IOrienteeringProblemData Data { get; }
     35    new IntegerVector Tour { get; }
     36    DoubleValue Quality { get; }
     37    DoubleValue Score { get; }
     38    DoubleValue TravelCosts { get; }
     39  }
     40
    3341  [Item("OrienteeringSolution", "Represents a Orienteering solution which can be visualized in the GUI.")]
    3442  [StorableType("BC58ED08-B9A7-40F3-B8E0-A6B33AA993F4")]
    35   public sealed class OrienteeringSolution : Item, ITSPSolution {
     43  public sealed class OrienteeringSolution : Item, IOrienteeringSolution {
    3644    public static new Image StaticItemImage {
    3745      get { return HeuristicLab.Common.Resources.VSImageLibrary.Image; }
     
    4048    [Storable] private Permutation routeAsPermutation;
    4149    [Storable] private IntegerVector route;
    42     public IntegerVector Route {
     50    public IntegerVector Tour {
    4351      get { return route; }
    4452      set {
     
    4654        route = value;
    4755        routeAsPermutation = new Permutation(PermutationTypes.RelativeDirected, value);
    48         OnPropertyChanged(nameof(Route));
    49         OnPropertyChanged(nameof(ITSPSolution.Tour));
     56        OnPropertyChanged(nameof(Tour));
    5057      }
    5158    }
    52     [Storable] private IOrienteeringProblemData opData;
    53     public IOrienteeringProblemData OPData {
    54       get { return opData; }
     59    [Storable] private IOrienteeringProblemData data;
     60    public IOrienteeringProblemData Data {
     61      get { return data; }
    5562      set {
    56         if (opData == value) return;
    57         opData = value;
    58         OnPropertyChanged(nameof(OPData));
    59         OnPropertyChanged(nameof(ITSPSolution.TSPData));
     63        if (data == value) return;
     64        data = value;
     65        OnPropertyChanged(nameof(Data));
    6066      }
    6167    }
     
    9298    }
    9399
    94     ITSPData ITSPSolution.TSPData => OPData.RoutingData;
     100    ITSPData ITSPSolution.Data => Data;
    95101    Permutation ITSPSolution.Tour => routeAsPermutation;
    96102    DoubleValue ITSPSolution.TourLength => TravelCosts;
     
    102108      this.route = cloner.Clone(original.route);
    103109      this.routeAsPermutation = cloner.Clone(original.routeAsPermutation);
    104       this.opData = cloner.Clone(original.opData);
     110      this.data = cloner.Clone(original.data);
    105111      this.quality = cloner.Clone(original.quality);
    106112      this.score = cloner.Clone(original.score);
     
    112118      this.route = route;
    113119      this.routeAsPermutation = new Permutation(PermutationTypes.RelativeDirected, route);
    114       this.opData = opData;
     120      this.data = opData;
    115121      this.quality = quality;
    116122      this.score = score;
Note: See TracChangeset for help on using the changeset viewer.