Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17533


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

#2521: Unified architecture

Location:
branches/2521_ProblemRefactoring
Files:
1 added
29 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering.Views/3.3/OrienteeringProblemDataView.Designer.cs

    r17529 r17533  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      HeuristicLab.Problems.TravelingSalesman.Views.TSPVisualizer tspVisualizer1 = new HeuristicLab.Problems.TravelingSalesman.Views.TSPVisualizer();
    4748      this.tabControl = new System.Windows.Forms.TabControl();
    4849      this.routingDataTabPage = new System.Windows.Forms.TabPage();
    49       this.routingDataViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5050      this.OrienteeringDataTabPage = new System.Windows.Forms.TabPage();
    5151      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
     
    6060      this.startingPointTextBox = new System.Windows.Forms.TextBox();
    6161      this.startingPointLabel = new System.Windows.Forms.Label();
     62      this.tspDataView = new HeuristicLab.Problems.TravelingSalesman.Views.ITSPDataView();
    6263      this.tabControl.SuspendLayout();
    6364      this.routingDataTabPage.SuspendLayout();
     
    8283      // routingDataTabPage
    8384      //
    84       this.routingDataTabPage.Controls.Add(this.routingDataViewHost);
     85      this.routingDataTabPage.Controls.Add(this.tspDataView);
    8586      this.routingDataTabPage.Location = new System.Drawing.Point(4, 22);
    8687      this.routingDataTabPage.Name = "routingDataTabPage";
     
    9091      this.routingDataTabPage.Text = "Routing Data";
    9192      this.routingDataTabPage.UseVisualStyleBackColor = true;
    92       //
    93       // routingDataViewHost
    94       //
    95       this.routingDataViewHost.Caption = "View";
    96       this.routingDataViewHost.Content = null;
    97       this.routingDataViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    98       this.routingDataViewHost.Enabled = false;
    99       this.routingDataViewHost.Location = new System.Drawing.Point(3, 3);
    100       this.routingDataViewHost.Name = "routingDataViewHost";
    101       this.routingDataViewHost.ReadOnly = false;
    102       this.routingDataViewHost.Size = new System.Drawing.Size(527, 395);
    103       this.routingDataViewHost.TabIndex = 0;
    104       this.routingDataViewHost.ViewsLabelVisible = true;
    105       this.routingDataViewHost.ViewType = null;
    10693      //
    10794      // OrienteeringDataTabPage
     
    238225      this.startingPointLabel.TabIndex = 0;
    239226      this.startingPointLabel.Text = "Starting Point:";
     227      //
     228      // tspDataView
     229      //
     230      this.tspDataView.Caption = "TSP Data View";
     231      this.tspDataView.Content = null;
     232      this.tspDataView.Dock = System.Windows.Forms.DockStyle.Fill;
     233      this.tspDataView.Location = new System.Drawing.Point(3, 3);
     234      this.tspDataView.Name = "tspDataView";
     235      this.tspDataView.ReadOnly = false;
     236      this.tspDataView.Size = new System.Drawing.Size(527, 395);
     237      this.tspDataView.TabIndex = 0;
     238      tspVisualizer1.Coordinates = null;
     239      tspVisualizer1.Tour = null;
     240      this.tspDataView.Visualizer = tspVisualizer1;
    240241      //
    241242      // OrienteeringProblemDataView
     
    263264    private System.Windows.Forms.TabControl tabControl;
    264265    private System.Windows.Forms.TabPage routingDataTabPage;
    265     private MainForm.WindowsForms.ViewHost routingDataViewHost;
    266266    private System.Windows.Forms.TabPage OrienteeringDataTabPage;
    267267    private System.Windows.Forms.SplitContainer splitContainer1;
     
    276276    private System.Windows.Forms.TextBox terminalPointTextBox;
    277277    private System.Windows.Forms.Label terminalPointLabel;
     278    private TravelingSalesman.Views.ITSPDataView tspDataView;
    278279  }
    279280}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering.Views/3.3/OrienteeringProblemDataView.cs

    r17529 r17533  
    2222using HeuristicLab.Core.Views;
    2323using HeuristicLab.MainForm;
    24 using HeuristicLab.Problems.TravelingSalesman.Views;
    2524
    2625namespace HeuristicLab.Problems.Orienteering.Views {
     
    4140      base.OnContentChanged();
    4241      if (Content == null) {
    43         routingDataViewHost.Content = null;
    4442        startingPointTextBox.Text = string.Empty;
    4543        terminalPointTextBox.Text = string.Empty;
     
    4846        scoresArrayView.Content = null;
    4947      } else {
    50         routingDataViewHost.Content = Content.RoutingData;
    5148        startingPointTextBox.Text = Content.StartingPoint.ToString();
    5249        terminalPointTextBox.Text = Content.TerminalPoint.ToString();
     
    5451        maximumTravelCostsTextBox.Text = Content.MaximumTravelCosts.ToString();
    5552        scoresArrayView.Content = Content.Scores;
    56         if (routingDataViewHost.ActiveView is ITSPVisualizerView tspVis)
    57           tspVis.Visualizer = new OrienteeringVisualizer() {
    58             Data = Content
    59           };
    6053      }
     54      tspDataView.Content = Content?.RoutingData;
    6155    }
    6256  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering.Views/3.3/OrienteeringSolutionView.Designer.cs

    r17526 r17533  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      HeuristicLab.Problems.TravelingSalesman.Views.TSPVisualizer tspVisualizer2 = new HeuristicLab.Problems.TravelingSalesman.Views.TSPVisualizer();
    4748      this.scoreLabel = new System.Windows.Forms.Label();
    4849      this.qualityLabel = new System.Windows.Forms.Label();
    4950      this.qualityValueView = new HeuristicLab.Data.Views.StringConvertibleValueView();
    5051      this.scoreValueView = new HeuristicLab.Data.Views.StringConvertibleValueView();
    51       this.tabControl.SuspendLayout();
    52       this.visualizationTabPage.SuspendLayout();
    53       ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
    54       this.routeTabPage.SuspendLayout();
     52      this.tspSolutionView = new HeuristicLab.Problems.TravelingSalesman.Views.TSPSolutionView();
    5553      this.SuspendLayout();
    56       //
    57       // tabControl
    58       //
    59       this.tabControl.Location = new System.Drawing.Point(3, 88);
    60       this.tabControl.Size = new System.Drawing.Size(417, 314);
    61       //
    62       // visualizationTabPage
    63       //
    64       this.visualizationTabPage.Size = new System.Drawing.Size(409, 288);
    65       //
    66       // pictureBox
    67       //
    68       this.pictureBox.Size = new System.Drawing.Size(403, 282);
    69       //
    70       // routeTabPage
    71       //
    72       this.routeTabPage.Size = new System.Drawing.Size(409, 234);
    73       //
    74       // tourViewHost
    75       //
    76       this.tourViewHost.Size = new System.Drawing.Size(403, 228);
    77       //
    78       // distanceView
    79       //
    80       this.distanceView.Location = new System.Drawing.Point(62, 61);
    81       //
    82       // distanceLabel
    83       //
    84       this.distanceLabel.Location = new System.Drawing.Point(4, 64);
    8554      //
    8655      // scoreLabel
     
    11281      this.qualityValueView.Name = "qualityValueView";
    11382      this.qualityValueView.ReadOnly = false;
    114       this.qualityValueView.Size = new System.Drawing.Size(357, 21);
     83      this.qualityValueView.Size = new System.Drawing.Size(565, 21);
    11584      this.qualityValueView.TabIndex = 0;
    11685      //
     
    12594      this.scoreValueView.Name = "scoreValueView";
    12695      this.scoreValueView.ReadOnly = false;
    127       this.scoreValueView.Size = new System.Drawing.Size(357, 21);
     96      this.scoreValueView.Size = new System.Drawing.Size(565, 21);
    12897      this.scoreValueView.TabIndex = 0;
     98      //
     99      // tspSolutionView
     100      //
     101      this.tspSolutionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     102            | System.Windows.Forms.AnchorStyles.Left)
     103            | System.Windows.Forms.AnchorStyles.Right)));
     104      this.tspSolutionView.Caption = "TSP Solution View";
     105      this.tspSolutionView.Content = null;
     106      this.tspSolutionView.Location = new System.Drawing.Point(0, 61);
     107      this.tspSolutionView.Name = "tspSolutionView";
     108      this.tspSolutionView.ReadOnly = false;
     109      this.tspSolutionView.Size = new System.Drawing.Size(630, 252);
     110      this.tspSolutionView.TabIndex = 2;
     111      tspVisualizer2.Coordinates = null;
     112      tspVisualizer2.Tour = null;
     113      this.tspSolutionView.Visualizer = tspVisualizer2;
    129114      //
    130115      // OrienteeringSolutionView
    131116      //
    132117      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     118      this.Controls.Add(this.tspSolutionView);
    133119      this.Controls.Add(this.scoreLabel);
    134120      this.Controls.Add(this.qualityLabel);
     
    136122      this.Controls.Add(this.scoreValueView);
    137123      this.Name = "OrienteeringSolutionView";
    138       this.Controls.SetChildIndex(this.scoreValueView, 0);
    139       this.Controls.SetChildIndex(this.qualityValueView, 0);
    140       this.Controls.SetChildIndex(this.qualityLabel, 0);
    141       this.Controls.SetChildIndex(this.scoreLabel, 0);
    142       this.Controls.SetChildIndex(this.tabControl, 0);
    143       this.Controls.SetChildIndex(this.distanceView, 0);
    144       this.Controls.SetChildIndex(this.distanceLabel, 0);
    145       this.tabControl.ResumeLayout(false);
    146       this.visualizationTabPage.ResumeLayout(false);
    147       ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
    148       this.routeTabPage.ResumeLayout(false);
     124      this.Size = new System.Drawing.Size(630, 313);
    149125      this.ResumeLayout(false);
    150126      this.PerformLayout();
     
    157133    private Data.Views.StringConvertibleValueView qualityValueView;
    158134    private Data.Views.StringConvertibleValueView scoreValueView;
     135    private TravelingSalesman.Views.TSPSolutionView tspSolutionView;
    159136  }
    160137}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering.Views/3.3/OrienteeringSolutionView.cs

    r17526 r17533  
    2121
    2222using System.ComponentModel;
     23using HeuristicLab.Core.Views;
    2324using HeuristicLab.MainForm;
    24 using HeuristicLab.Problems.TravelingSalesman.Views;
    2525
    2626namespace HeuristicLab.Problems.Orienteering.Views {
    2727  [View("OrienteeringSolution View")]
    28   [Content(typeof(OrienteeringSolution), true)]
    29   public partial class OrienteeringSolutionView : TSPSolutionView {
    30     public new OrienteeringVisualizer Visualizer {
    31       get { return (OrienteeringVisualizer)base.Visualizer; }
    32       set { base.Visualizer = value; }
    33     }
    34     public new OrienteeringSolution Content {
    35       get { return (OrienteeringSolution)base.Content; }
     28  [Content(typeof(IOrienteeringSolution), true)]
     29  public partial class OrienteeringSolutionView : ItemView {
     30    public OrienteeringVisualizer Visualizer { get; set; }
     31
     32    public new IOrienteeringSolution Content {
     33      get { return (IOrienteeringSolution)base.Content; }
    3634      set { base.Content = value; }
    3735    }
     
    3937      InitializeComponent();
    4038      Visualizer = new OrienteeringVisualizer();
     39      tspSolutionView.Visualizer = Visualizer;
    4140    }
    4241
     
    5049    }
    5150
    52     protected override void ContentOnPropertyChanged(object sender, PropertyChangedEventArgs e) {
    53       base.ContentOnPropertyChanged(sender, e);
     51    protected virtual void ContentOnPropertyChanged(object sender, PropertyChangedEventArgs e) {
    5452      switch (e.PropertyName) {
    5553        case nameof(Content.Quality):
     
    7169        qualityValueView.Content = Content.Quality;
    7270        scoreValueView.Content = Content.Score;
    73         Visualizer.Data = Content.OPData;
    74         Visualizer.IsFeasible = Content.TravelCosts.Value <= Content.OPData.MaximumTravelCosts;
     71        Visualizer.Data = Content.Data;
     72        Visualizer.IsFeasible = Content.TravelCosts.Value <= Content.Data.MaximumTravelCosts;
    7573      }
     74      tspSolutionView.Content = Content;
    7675      base.OnContentChanged();
    7776    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering.Views/3.3/OrienteeringVisualizer.cs

    r17525 r17533  
    3636
    3737      if ((coordinates != null) && (coordinates.Rows > 0) && (coordinates.Columns == 2)
    38         && (coordinates.Rows == Data.RoutingData.Cities)) {
     38        && (coordinates.Rows == Data.Cities)) {
    3939        double xMin = double.MaxValue, yMin = double.MaxValue, xMax = double.MinValue, yMax = double.MinValue;
    4040        for (int i = 0; i < coordinates.Rows; i++) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/Creators/GreedyOrienteeringTourCreator.cs

    r17525 r17533  
    6666      // Find all points within the maximum distance allowed (ellipse)
    6767      var feasiblePoints = (
    68         from point in Enumerable.Range(0, data.RoutingData.Cities)
    69         let travelCosts = data.RoutingData.GetDistance(data.StartingPoint, point)
    70         + data.RoutingData.GetDistance(point, data.TerminalPoint) + data.PointVisitingCosts
     68        from point in Enumerable.Range(0, data.Cities)
     69        let travelCosts = data.GetDistance(data.StartingPoint, point)
     70        + data.GetDistance(point, data.TerminalPoint) + data.PointVisitingCosts
    7171        let score = data.GetScore(point)
    7272        where travelCosts <= data.MaximumTravelCosts
     
    8181        data.TerminalPoint
    8282      };
    83       double tourLength = data.RoutingData.GetDistance(data.StartingPoint, data.TerminalPoint);
     83      double tourLength = data.GetDistance(data.StartingPoint, data.TerminalPoint);
    8484
    8585      // Add points in a greedy way
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs

    r17525 r17533  
    126126
    127127        // Determine all points that have not yet been visited by this tour
    128         var visitablePoints = Enumerable.Range(0, data.RoutingData.Cities).Except(tour).ToList();
     128        var visitablePoints = Enumerable.Range(0, data.Cities).Except(tour).ToList();
    129129
    130130        // Determine if any of the visitable points can be included at any position within the tour
     
    168168            double newLength = tourLength;
    169169            // Recalculate length of whole swapped part, in case distances are not symmetric
    170             for (int index = position - 1; index < position + blockLength; index++) newLength -= data.RoutingData.GetDistance(tour[index], tour[index + 1]);
    171             for (int index = position + blockLength - 1; index > position; index--) newLength += data.RoutingData.GetDistance(tour[index], tour[index - 1]);
    172             newLength += data.RoutingData.GetDistance(tour[position - 1], tour[position + blockLength - 1]);
    173             newLength += data.RoutingData.GetDistance(tour[position], tour[position + blockLength]);
     170            for (int index = position - 1; index < position + blockLength; index++) newLength -= data.GetDistance(tour[index], tour[index + 1]);
     171            for (int index = position + blockLength - 1; index > position; index--) newLength += data.GetDistance(tour[index], tour[index - 1]);
     172            newLength += data.GetDistance(tour[position - 1], tour[position + blockLength - 1]);
     173            newLength += data.GetDistance(tour[position], tour[position + blockLength]);
    174174
    175175            if (newLength < tourLength - 0.00001) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs

    r17529 r17533  
    9696    }
    9797    public static double CalculateTravelCosts(IOrienteeringProblemData data, IntegerVector solution) {
    98       var distance = data.RoutingData.GetPathDistance(solution, closed: false);
     98      var distance = data.GetPathDistance(solution, closed: false);
    9999      distance += (solution.Length - 2) * data.PointVisitingCosts;
    100100      return distance;
    101101    }
    102102    public static double CalculateTravelCosts(IOrienteeringProblemData data, IList<int> solution) {
    103       var distance = data.RoutingData.GetPathDistance(solution, closed: false);
     103      var distance = data.GetPathDistance(solution, closed: false);
    104104      distance += (solution.Count - 2) * data.PointVisitingCosts;
    105105      return distance;
     
    127127    }
    128128    public static double CalculateInsertionCosts(IOrienteeringProblemData data, IList<int> path, int insertPosition, int point) {
    129       double detour = data.RoutingData.GetDistance(path[insertPosition - 1], point) + data.RoutingData.GetDistance(point, path[insertPosition]);
     129      double detour = data.GetDistance(path[insertPosition - 1], point) + data.GetDistance(point, path[insertPosition]);
    130130      detour += data.PointVisitingCosts;
    131       detour -= data.RoutingData.GetDistance(path[insertPosition - 1], path[insertPosition]);
     131      detour -= data.GetDistance(path[insertPosition - 1], path[insertPosition]);
    132132      return detour;
    133133    }
    134134    public static double CalculateReplacementCosts(IOrienteeringProblemData data, IList<int> path, int replacePosition, int point) {
    135       double detour = data.RoutingData.GetDistance(path[replacePosition - 1], point) + data.RoutingData.GetDistance(point, path[replacePosition + 1]);
    136       detour -= data.RoutingData.GetDistance(path[replacePosition - 1], path[replacePosition]) + data.RoutingData.GetDistance(path[replacePosition], path[replacePosition + 1]);
     135      double detour = data.GetDistance(path[replacePosition - 1], point) + data.GetDistance(point, path[replacePosition + 1]);
     136      detour -= data.GetDistance(path[replacePosition - 1], path[replacePosition]) + data.GetDistance(path[replacePosition], path[replacePosition + 1]);
    137137      return detour;
    138138    }
    139139    public static double CalculateRemovementSaving(IOrienteeringProblemData data, IList<int> path, int removePosition) {
    140       double saving = data.RoutingData.GetDistance(path[removePosition - 1], path[removePosition]);
    141       saving += data.RoutingData.GetDistance(path[removePosition], path[removePosition + 1]);
    142       saving -= data.RoutingData.GetDistance(path[removePosition - 1], path[removePosition + 1]);
     140      double saving = data.GetDistance(path[removePosition - 1], path[removePosition]);
     141      saving += data.GetDistance(path[removePosition], path[removePosition + 1]);
     142      saving -= data.GetDistance(path[removePosition - 1], path[removePosition + 1]);
    143143      saving += data.PointVisitingCosts;
    144144      return saving;
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblemdata.cs

    r17531 r17533  
    11using System;
     2using System.Collections.Generic;
    23using HEAL.Attic;
    34using HeuristicLab.Common;
     
    56using HeuristicLab.Data;
    67using HeuristicLab.Encodings.IntegerVectorEncoding;
     8using HeuristicLab.Encodings.PermutationEncoding;
     9using HeuristicLab.Problems.Instances;
    710using HeuristicLab.Problems.Instances.Types;
    811using HeuristicLab.Problems.TravelingSalesman;
     
    1013namespace HeuristicLab.Problems.Orienteering {
    1114  [StorableType("c33063a6-a2ee-4054-9dd8-46a738003139")]
    12   public interface IOrienteeringProblemData : INamedItem {
    13     ITSPData RoutingData { get; }
     15  public interface IOrienteeringProblemData : ITSPData {
    1416    int StartingPoint { get; }
    1517    int TerminalPoint { get; }
     
    1921    double GetScore(int city);
    2022    OrienteeringSolution GetSolution(IntegerVector route, double quality, double score, double travelCosts);
    21     OPData Export();
     23    new OPData Export();
    2224  }
    2325
     
    9395    }
    9496
     97    #region ITSPData members
     98    int ITSPData.Cities => RoutingData.Cities;
     99    double ITSPData.GetDistance(int fromCity, int toCity) => RoutingData.GetDistance(fromCity, toCity);
     100    double ITSPData.GetPathDistance(IEnumerable<int> path, bool closed) => RoutingData.GetPathDistance(path, closed);
     101    ITSPSolution ITSPData.GetSolution(Permutation tspTour, double tourLength) => RoutingData.GetSolution(tspTour, tourLength);
     102    TSPData ITSPData.Export() => RoutingData.Export();
     103    DoubleMatrix ITSPData.GetCoordinatesOrDefault() => RoutingData.GetCoordinatesOrDefault();
     104    #endregion
     105
    95106    private static double[,] defaultCoordinates = new double[21, 2] {
    96107      {  4.60,  7.10 }, {  5.70, 11.40 }, {  4.40, 12.30 }, {  2.80, 14.30 }, {  3.20, 10.30 },
  • 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;
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/Shakers/OrienteeringShakingOperator.cs

    r17525 r17533  
    9696      var initialTour = IntegerVectorParameter.ActualValue;
    9797      var data = OrienteeringProblemDataParameter.ActualValue;
    98       int numPoints = data.RoutingData.Cities;
     98      int numPoints = data.Cities;
    9999
    100100      if (NeighborhoodCountParameter.ActualValue == null)
     
    117117          from point in Enumerable.Range(0, numPoints)
    118118          // Calculate the distance when going from the starting point to this point and then to the end point
    119           let distance = data.RoutingData.GetDistance(data.StartingPoint, point) + data.RoutingData.GetDistance(point, data.TerminalPoint) + data.PointVisitingCosts
     119          let distance = data.GetDistance(data.StartingPoint, point) + data.GetDistance(point, data.TerminalPoint) + data.PointVisitingCosts
    120120          // If this distance is feasible and the point is neither starting nor ending point, check the point
    121121          where distance < data.MaximumTravelCosts && point != data.StartingPoint && point != data.TerminalPoint
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP.Views/3.3/Plugin.cs.frame

    r17361 r17533  
    2525  [Plugin("HeuristicLab.Problems.PTSP.Views", "3.3.16.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Problems.PTSP.Views-3.3.dll", PluginFileType.Assembly)]
    27   [PluginDependency("HeuristicLab.Common", "3.3")]
    2827  [PluginDependency("HeuristicLab.Core", "3.3")]
    2928  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP.Views/3.3/ProbabilisticTSPDataView.Designer.cs

    r17335 r17533  
    2828      this.probabilitiesTabPage = new System.Windows.Forms.TabPage();
    2929      this.probabilitiesView = new HeuristicLab.Data.Views.StringConvertibleArrayView();
    30       this.tspViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     30      this.tspDataView = new HeuristicLab.Problems.TravelingSalesman.Views.ITSPDataView();
    3131      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    3232      this.tabControl.SuspendLayout();
     
    5555      // coordinatesTabPage
    5656      //
    57       this.coordinatesTabPage.Controls.Add(this.tspViewHost);
     57      this.coordinatesTabPage.Controls.Add(this.tspDataView);
    5858      this.coordinatesTabPage.Location = new System.Drawing.Point(4, 22);
    5959      this.coordinatesTabPage.Name = "coordinatesTabPage";
     
    8686      this.probabilitiesView.TabIndex = 0;
    8787      //
    88       // tspViewHost
     88      // tspDataView
    8989      //
    90       this.tspViewHost.Caption = "View";
    91       this.tspViewHost.Content = null;
    92       this.tspViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    93       this.tspViewHost.Enabled = false;
    94       this.tspViewHost.Location = new System.Drawing.Point(3, 3);
    95       this.tspViewHost.Name = "tspViewHost";
    96       this.tspViewHost.ReadOnly = false;
    97       this.tspViewHost.Size = new System.Drawing.Size(337, 360);
    98       this.tspViewHost.TabIndex = 0;
    99       this.tspViewHost.ViewsLabelVisible = true;
    100       this.tspViewHost.ViewType = null;
     90      this.tspDataView.Caption = "TSP Data View";
     91      this.tspDataView.Content = null;
     92      this.tspDataView.Dock = System.Windows.Forms.DockStyle.Fill;
     93      this.tspDataView.Location = new System.Drawing.Point(3, 3);
     94      this.tspDataView.Name = "tspDataView";
     95      this.tspDataView.ReadOnly = false;
     96      this.tspDataView.Size = new System.Drawing.Size(337, 360);
     97      this.tspDataView.TabIndex = 0;
    10198      //
    10299      // ProbabilisticTSPDataView
     
    124121    private System.Windows.Forms.TabPage probabilitiesTabPage;
    125122    private Data.Views.StringConvertibleArrayView probabilitiesView;
    126     private MainForm.WindowsForms.ViewHost tspViewHost;
     123    private TravelingSalesman.Views.ITSPDataView tspDataView;
    127124  }
    128125}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP.Views/3.3/ProbabilisticTSPDataView.cs

    r17335 r17533  
    2424using HeuristicLab.MainForm;
    2525using HeuristicLab.MainForm.WindowsForms;
    26 using HeuristicLab.Problems.TravelingSalesman.Views;
    2726
    2827namespace HeuristicLab.Problems.PTSP.Views {
     
    4140      InitializeComponent();
    4241      Visualizer = new ProbabilisticTSPVisualizer();
     42      tspDataView.Visualizer = Visualizer;
    4343    }
    4444
     
    4747      if (Content == null) {
    4848        probabilitiesView.Content = null;
    49         tspViewHost.Content = null;
    5049        Visualizer.Probabilities = null;
    5150      } else {
    5251        probabilitiesView.Content = Content.Probabilities;
    5352        Visualizer.Probabilities = Content.Probabilities;
    54         tspViewHost.Content = Content.TSPData;
    55         if (tspViewHost.ActiveView is ITSPVisualizerView view)
    56           view.Visualizer = Visualizer;
    5753      }
     54      tspDataView.Content = Content?.TSPData;
    5855    }
    5956
     
    6158      base.SetEnabledStateOfControls();
    6259      probabilitiesView.Enabled = !ReadOnly && !Locked && Content != null;
    63       tspViewHost.Enabled = !ReadOnly && !Locked && Content != null;
     60      tspDataView.Enabled = !ReadOnly && !Locked && Content != null;
    6461    }
    6562  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP.Views/3.3/ProbabilisticTSPSolutionView.Designer.cs

    r17260 r17533  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      HeuristicLab.Problems.TravelingSalesman.Views.TSPVisualizer tspVisualizer1 = new HeuristicLab.Problems.TravelingSalesman.Views.TSPVisualizer();
     48      this.tspSolutionView = new HeuristicLab.Problems.TravelingSalesman.Views.TSPSolutionView();
     49      this.SuspendLayout();
     50      //
     51      // tspSolutionView
     52      //
     53      this.tspSolutionView.Caption = "TSP Solution View";
     54      this.tspSolutionView.Content = null;
     55      this.tspSolutionView.Dock = System.Windows.Forms.DockStyle.Fill;
     56      this.tspSolutionView.Location = new System.Drawing.Point(0, 0);
     57      this.tspSolutionView.Name = "tspSolutionView";
     58      this.tspSolutionView.ReadOnly = false;
     59      this.tspSolutionView.Size = new System.Drawing.Size(704, 496);
     60      this.tspSolutionView.TabIndex = 0;
     61      tspVisualizer1.Coordinates = null;
     62      tspVisualizer1.Tour = null;
     63      this.tspSolutionView.Visualizer = tspVisualizer1;
     64      //
     65      // ProbabilisticTSPSolutionView
     66      //
     67      this.Controls.Add(this.tspSolutionView);
     68      this.Name = "ProbabilisticTSPSolutionView";
     69      this.Size = new System.Drawing.Size(704, 496);
     70      this.ResumeLayout(false);
     71
    4772    }
    4873    #endregion
     74
     75    private TravelingSalesman.Views.TSPSolutionView tspSolutionView;
    4976  }
    5077}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP.Views/3.3/ProbabilisticTSPSolutionView.cs

    r17335 r17533  
    2020#endregion
    2121
    22 using System;
    23 using System.Drawing;
    2422using HeuristicLab.Core.Views;
    25 using HeuristicLab.Data;
    26 using HeuristicLab.Encodings.PermutationEncoding;
    2723using HeuristicLab.MainForm;
    28 using HeuristicLab.Problems.TravelingSalesman.Views;
    2924
    3025namespace HeuristicLab.Problems.PTSP.Views {
     
    3530  [Content(typeof(IProbabilisticTSPSolution), true)]
    3631  public sealed partial class ProbabilisticTSPSolutionView : ItemView {
    37     public TSPVisualizer Visualizer { get; set; }
     32
     33    public ProbabilisticTSPVisualizer Visualizer { get; set; }
    3834
    3935    public new IProbabilisticTSPSolution Content {
     
    4844      InitializeComponent();
    4945      Visualizer = new ProbabilisticTSPVisualizer();
     46      tspSolutionView.Visualizer = Visualizer;
     47    }
     48
     49    protected override void OnContentChanged() {
     50      base.OnContentChanged();
     51      if (Content == null)
     52        Visualizer.Probabilities = null;
     53      else Visualizer.Probabilities = Content.Probabilities;
     54      tspSolutionView.Content = Content;
    5055    }
    5156  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/AnalyticalPTSP.cs

    r17382 r17533  
    7171      for (var i = 0; i < tour.Length - 1; i++) {
    7272        for (var j = i + 1; j < tour.Length; j++) {
    73           var prod1 = data.TSPData.GetDistance(tour[i], tour[j]) * data.GetProbability(tour[i]) * data.GetProbability(tour[j]);
     73          var prod1 = data.GetDistance(tour[i], tour[j]) * data.GetProbability(tour[i]) * data.GetProbability(tour[j]);
    7474          for (var k = i + 1; k < j; k++) {
    7575            prod1 *= (1 - data.GetProbability(tour[k]));
     
    8181      for (var j = 0; j < tour.Length; j++) {
    8282        for (var i = 0; i < j; i++) {
    83           var prod2 = data.TSPData.GetDistance(tour[j], tour[i]) * data.GetProbability(tour[i]) * data.GetProbability(tour[j]);
     83          var prod2 = data.GetDistance(tour[j], tour[i]) * data.GetProbability(tour[i]) * data.GetProbability(tour[j]);
    8484          for (var k = j + 1; k < tour.Length; k++) {
    8585            prod2 *= (1 - data.GetProbability(tour[k]));
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/EstimatedPTSP.cs

    r17382 r17533  
    119119      foreach (var r in realizations) {
    120120        int singleRealization = -1, firstNode = -1;
    121         for (var j = 0; j < data.TSPData.Cities; j++) {
     121        for (var j = 0; j < data.Cities; j++) {
    122122          if (r[tour[j]]) {
    123123            if (singleRealization != -1) {
    124               estimatedSum += data.TSPData.GetDistance(singleRealization, tour[j]);
     124              estimatedSum += data.GetDistance(singleRealization, tour[j]);
    125125            } else {
    126126              firstNode = tour[j];
     
    130130        }
    131131        if (singleRealization != -1)
    132           estimatedSum += data.TSPData.GetDistance(singleRealization, firstNode);
     132          estimatedSum += data.GetDistance(singleRealization, firstNode);
    133133        count++;
    134134      }
     
    153153        var pSum = 0.0;
    154154        int singleRealization = -1, firstNode = -1;
    155         for (var j = 0; j < data.TSPData.Cities; j++) {
     155        for (var j = 0; j < data.Cities; j++) {
    156156          if (r[tour[j]]) {
    157157            if (singleRealization != -1) {
    158               pSum += data.TSPData.GetDistance(singleRealization, tour[j]);
     158              pSum += data.GetDistance(singleRealization, tour[j]);
    159159            } else {
    160160              firstNode = tour[j];
     
    164164        }
    165165        if (singleRealization != -1) {
    166           pSum += data.TSPData.GetDistance(singleRealization, firstNode);
     166          pSum += data.GetDistance(singleRealization, firstNode);
    167167        }
    168168        estimatedSum += pSum;
     
    201201      var data = new List<BoolArray>(Realizations);
    202202      var rng = new MersenneTwister((uint)RealizationsSeed);
    203       if (Enumerable.Range(0, ProbabilisticTSPData.TSPData.Cities).All(c => ProbabilisticTSPData.GetProbability(c) <= 0))
     203      if (Enumerable.Range(0, ProbabilisticTSPData.Cities).All(c => ProbabilisticTSPData.GetProbability(c) <= 0))
    204204        throw new InvalidOperationException("All probabilities are zero.");
    205205      while (data.Count < Realizations) {
    206206        var cities = 0;
    207         var r = new bool[ProbabilisticTSPData.TSPData.Cities];
    208         for (var j = 0; j < ProbabilisticTSPData.TSPData.Cities; j++) {
     207        var r = new bool[ProbabilisticTSPData.Cities];
     208        for (var j = 0; j < ProbabilisticTSPData.Cities; j++) {
    209209          if (rng.NextDouble() < ProbabilisticTSPData.GetProbability(j)) {
    210210            r[j] = true;
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/Moves/OneShift/PTSPEstimatedInsertionMoveEvaluator.cs

    r17335 r17533  
    126126          !(aPosteriori[2] == aPosteriori[4] && aPosteriori[3] == aPosteriori[5])) {
    127127          // compute cost difference between the two a posteriori solutions
    128           moveQuality = moveQuality + data.TSPData.GetDistance(aPosteriori[6], aPosteriori[7]) + data.TSPData.GetDistance(aPosteriori[8], aPosteriori[9]) + data.TSPData.GetDistance(aPosteriori[10], aPosteriori[11]);
    129           moveQuality = moveQuality - data.TSPData.GetDistance(aPosteriori[0], aPosteriori[1]) - data.TSPData.GetDistance(aPosteriori[2], aPosteriori[3]) - data.TSPData.GetDistance(aPosteriori[4], aPosteriori[5]);
     128          moveQuality = moveQuality + data.GetDistance(aPosteriori[6], aPosteriori[7]) + data.GetDistance(aPosteriori[8], aPosteriori[9]) + data.GetDistance(aPosteriori[10], aPosteriori[11]);
     129          moveQuality = moveQuality - data.GetDistance(aPosteriori[0], aPosteriori[1]) - data.GetDistance(aPosteriori[2], aPosteriori[3]) - data.GetDistance(aPosteriori[4], aPosteriori[5]);
    130130        }
    131131        Array.Clear(aPosteriori, 0, aPosteriori.Length);
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/Moves/TwoOpt/PTSPEstimatedInversionMoveEvaluator.cs

    r17335 r17533  
    8989        // compute cost difference between the two a posteriori solutions
    9090        if (!(aPosteriori[0] == aPosteriori[2] && aPosteriori[1] == aPosteriori[3])) {
    91           moveQuality = moveQuality + data.TSPData.GetDistance(aPosteriori[0], aPosteriori[2]) + data.TSPData.GetDistance(aPosteriori[1], aPosteriori[3])
    92             - data.TSPData.GetDistance(aPosteriori[0], aPosteriori[1]) - data.TSPData.GetDistance(aPosteriori[2], aPosteriori[3]);
     91          moveQuality = moveQuality + data.GetDistance(aPosteriori[0], aPosteriori[2]) + data.GetDistance(aPosteriori[1], aPosteriori[3])
     92            - data.GetDistance(aPosteriori[0], aPosteriori[1]) - data.GetDistance(aPosteriori[2], aPosteriori[3]);
    9393        }
    9494        Array.Clear(aPosteriori, 0, aPosteriori.Length);
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/ProbabilisticTSP.cs

    r17382 r17533  
    4242
    4343    #region Parameter Properties
    44     [Storable] public ValueParameter<IProbabilisticTSPData> PTSPDataParameter { get; private set; }
    45     [Storable] public OptionalValueParameter<IProbabilisticTSPSolution> BestKnownSolutionParameter { get; private set; }
     44    [Storable] public ValueParameter<IProbabilisticTSPData> PTSPDataParameter { get; }
     45    [Storable] public OptionalValueParameter<IProbabilisticTSPSolution> BestKnownSolutionParameter { get; }
    4646    #endregion
    4747
     
    7070
    7171      ProbabilisticTSPData = new ProbabilisticTSPData();
    72       Encoding.Length = ProbabilisticTSPData.TSPData.Cities;
     72      Encoding.Length = ProbabilisticTSPData.Cities;
    7373    }
    7474
    7575    protected override void OnEncodingChanged() {
    7676      base.OnEncodingChanged();
    77       Encoding.Length = ProbabilisticTSPData.TSPData.Cities;
     77      Encoding.Length = ProbabilisticTSPData.Cities;
    7878    }
    7979
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/ProbabilisticTSPData.cs

    r17525 r17533  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using HEAL.Attic;
     
    3233namespace HeuristicLab.Problems.PTSP {
    3334  [StorableType("dd2d0ecc-372e-46f1-846f-fb4ca2afa124")]
    34   public interface IProbabilisticTSPData : INamedItem {
    35     ITSPData TSPData { get; }
    36 
     35  public interface IProbabilisticTSPData : ITSPData {
    3736    double GetProbability(int city);
    38     IProbabilisticTSPSolution GetSolution(Permutation tspTour, double tourLength);
    39     PTSPData Export();
     37    new IProbabilisticTSPSolution GetSolution(Permutation tspTour, double tourLength);
     38    new PTSPData Export();
    4039  }
    4140
     
    8988      };
    9089    }
     90
     91    #region ITSPData members
     92    int ITSPData.Cities => TSPData.Cities;
     93    double ITSPData.GetDistance(int fromCity, int toCity) => TSPData.GetDistance(fromCity, toCity);
     94    double ITSPData.GetPathDistance(IEnumerable<int> path, bool closed) => TSPData.GetPathDistance(path, closed);
     95    ITSPSolution ITSPData.GetSolution(Permutation tspTour, double tourLength) => TSPData.GetSolution(tspTour, tourLength);
     96    TSPData ITSPData.Export() => TSPData.Export();
     97    DoubleMatrix ITSPData.GetCoordinatesOrDefault() => TSPData.GetCoordinatesOrDefault();
     98    #endregion
    9199  }
    92100}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.PTSP/3.3/ProbabilisticTSPSolution.cs

    r17335 r17533  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Data;
     28using HeuristicLab.Encodings.PermutationEncoding;
    2829using HeuristicLab.Problems.TravelingSalesman;
    2930
    3031namespace HeuristicLab.Problems.PTSP {
    3132  [StorableType("596f52b5-b2c8-45a0-a7bd-e5b9c787c960")]
    32   public interface IProbabilisticTSPSolution : IItem, INotifyPropertyChanged {
    33     ITSPSolution TSPSolution { get; }
    34     DoubleArray Probabilities { get; }
     33  public interface IProbabilisticTSPSolution : ITSPSolution {
     34    PercentArray Probabilities { get; }
    3535  }
    3636
     
    5757
    5858    [Storable]
    59     private DoubleArray probabilities;
    60     public DoubleArray Probabilities {
     59    private PercentArray probabilities;
     60    public PercentArray Probabilities {
    6161      get { return probabilities; }
    6262      set {
     
    6666      }
    6767    }
     68
     69    ITSPData ITSPSolution.Data => tspSolution.Data;
     70
     71    Permutation ITSPSolution.Tour => tspSolution.Tour;
     72
     73    DoubleValue ITSPSolution.TourLength => tspSolution.TourLength;
    6874
    6975    [StorableConstructor]
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TravelingSalesman.Views/3.3/HeuristicLab.Problems.TravelingSalesman.Views-3.3.csproj

    r17361 r17533  
    135135      <DependentUpon>EuclideanTSPDataView.cs</DependentUpon>
    136136    </Compile>
    137     <Compile Include="ITSPDataView.cs" />
     137    <Compile Include="ITSPDataView.cs">
     138      <SubType>UserControl</SubType>
     139    </Compile>
     140    <Compile Include="ITSPDataView.Designer.cs">
     141      <DependentUpon>ITSPDataView.cs</DependentUpon>
     142    </Compile>
    138143    <Compile Include="MatrixTSPDataView.cs">
    139144      <SubType>UserControl</SubType>
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TravelingSalesman.Views/3.3/ITSPDataView.cs

    r17335 r17533  
    2020#endregion
    2121
     22using HeuristicLab.Core.Views;
     23using HeuristicLab.MainForm;
     24
    2225namespace HeuristicLab.Problems.TravelingSalesman.Views {
    2326  public interface ITSPVisualizerView {
    2427    TSPVisualizer Visualizer { get; set; }
    2528  }
     29
     30  [View("TSP Data View")]
     31  [Content(typeof(ITSPData), IsDefaultView = true)]
     32  public partial class ITSPDataView : ItemView {
     33    public TSPVisualizer Visualizer { get; set; } = new TSPVisualizer();
     34
     35    public new ITSPData Content {
     36      get { return (ITSPData)base.Content; }
     37      set { base.Content = value; }
     38    }
     39
     40    public ITSPDataView() {
     41      InitializeComponent();
     42    }
     43
     44    protected override void OnContentChanged() {
     45      base.OnContentChanged();
     46      viewHost.Content = Content;
     47      if (viewHost.ActiveView is ITSPVisualizerView view)
     48        view.Visualizer = Visualizer;
     49    }
     50
     51  }
    2652}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TSPSolutionView.Designer.cs

    r17526 r17533  
    121121      // distanceView
    122122      //
     123      this.distanceView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     124            | System.Windows.Forms.AnchorStyles.Right)));
    123125      this.distanceView.Caption = "StringConvertibleValue View";
    124126      this.distanceView.Content = null;
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TSPSolutionView.cs

    r17526 r17533  
    6767      } else {
    6868        distanceView.Content = Content.TourLength;
    69         if (Content.TSPData is CoordinatesTSPData coordTsp)
    70           Visualizer.Coordinates = coordTsp.Coordinates;
    71         else if (Content.TSPData is MatrixTSPData matrixTsp)
    72           Visualizer.Coordinates = matrixTsp.DisplayCoordinates;
     69        Visualizer.Coordinates = Content.Data.GetCoordinatesOrDefault();
    7370        Visualizer.Tour = Content.Tour;
    7471        GenerateImage();
     
    9895      else {
    9996        switch (e.PropertyName) {
    100           case nameof(Content.TSPData):
    101             if (Content.TSPData is CoordinatesTSPData coordTsp)
     97          case nameof(Content.Data):
     98            if (Content.Data is CoordinatesTSPData coordTsp)
    10299              Visualizer.Coordinates = coordTsp.Coordinates;
    103             else if (Content.TSPData is MatrixTSPData matrixTsp)
     100            else if (Content.Data is MatrixTSPData matrixTsp)
    104101              Visualizer.Coordinates = matrixTsp.DisplayCoordinates;
    105102            GenerateImage();
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TravelingSalesman/3.3/TSPData.cs

    r17529 r17533  
    3838    ITSPSolution GetSolution(Permutation tspTour, double tourLength);
    3939    TSPData Export();
     40
     41    DoubleMatrix GetCoordinatesOrDefault();
    4042  }
    4143
     
    111113      };
    112114    }
     115
     116    public DoubleMatrix GetCoordinatesOrDefault() {
     117      return DisplayCoordinates;
     118    }
    113119  }
    114120
     
    178184
    179185    public abstract TSPData Export();
     186
     187    public DoubleMatrix GetCoordinatesOrDefault() {
     188      return Coordinates;
     189    }
    180190  }
    181191
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TravelingSalesman/3.3/TSPSolution.cs

    r17356 r17533  
    3131  [StorableType("f08a63d9-0b83-4944-9251-42925baeb872")]
    3232  public interface ITSPSolution : IItem, INotifyPropertyChanged {
    33     ITSPData TSPData { get; }
     33    ITSPData Data { get; }
    3434    Permutation Tour { get; }
    3535    DoubleValue TourLength { get; }
     
    4747
    4848    [Storable] private ITSPData tspData;
    49     public ITSPData TSPData {
     49    public ITSPData Data {
    5050      get { return tspData; }
    5151      set {
    5252        if (tspData == value) return;
    5353        tspData = value;
    54         OnPropertyChanged(nameof(TSPData));
     54        OnPropertyChanged(nameof(Data));
    5555      }
    5656    }
Note: See TracChangeset for help on using the changeset viewer.