Changeset 17533 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/OrienteeringSolution.cs
- Timestamp:
- 05/08/20 16:55:51 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/OrienteeringSolution.cs
r17526 r17533 31 31 32 32 namespace 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 33 41 [Item("OrienteeringSolution", "Represents a Orienteering solution which can be visualized in the GUI.")] 34 42 [StorableType("BC58ED08-B9A7-40F3-B8E0-A6B33AA993F4")] 35 public sealed class OrienteeringSolution : Item, I TSPSolution {43 public sealed class OrienteeringSolution : Item, IOrienteeringSolution { 36 44 public static new Image StaticItemImage { 37 45 get { return HeuristicLab.Common.Resources.VSImageLibrary.Image; } … … 40 48 [Storable] private Permutation routeAsPermutation; 41 49 [Storable] private IntegerVector route; 42 public IntegerVector Route{50 public IntegerVector Tour { 43 51 get { return route; } 44 52 set { … … 46 54 route = value; 47 55 routeAsPermutation = new Permutation(PermutationTypes.RelativeDirected, value); 48 OnPropertyChanged(nameof(Route)); 49 OnPropertyChanged(nameof(ITSPSolution.Tour)); 56 OnPropertyChanged(nameof(Tour)); 50 57 } 51 58 } 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; } 55 62 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)); 60 66 } 61 67 } … … 92 98 } 93 99 94 ITSPData ITSPSolution. TSPData => OPData.RoutingData;100 ITSPData ITSPSolution.Data => Data; 95 101 Permutation ITSPSolution.Tour => routeAsPermutation; 96 102 DoubleValue ITSPSolution.TourLength => TravelCosts; … … 102 108 this.route = cloner.Clone(original.route); 103 109 this.routeAsPermutation = cloner.Clone(original.routeAsPermutation); 104 this. opData = cloner.Clone(original.opData);110 this.data = cloner.Clone(original.data); 105 111 this.quality = cloner.Clone(original.quality); 106 112 this.score = cloner.Clone(original.score); … … 112 118 this.route = route; 113 119 this.routeAsPermutation = new Permutation(PermutationTypes.RelativeDirected, route); 114 this. opData = opData;120 this.data = opData; 115 121 this.quality = quality; 116 122 this.score = score;
Note: See TracChangeset
for help on using the changeset viewer.