Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/28/15 23:38:51 (9 years ago)
Author:
abeham
Message:

#2221:

  • Completely refactored PTSP branch
    • Added two sets of problem instances based on TSPLIB: homogeneous and heterogeneous
    • Implemented missing EvaluateByCoordinates for 1-shift moves
    • Made it clear that move evaluators are for estimated PTSP only
    • Changed parameter realization from a rather strange list of list of ints to a list of bool arrays
    • Reusing code of the 2-opt and 1-shift move evaluators in 2.5 move evaluator
    • Introducing distance calculators to properly handle the case when no distance matrix is given (previous code only worked with distance matrix and without only with euclidean distance in some settings)
    • Fixed several smaller code issues: protected, static, method parameters, copy & paste, interfaces, naming, parameters, serialization hooks, license headers, doc comments, data types
Location:
branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/HeuristicLab.Problems.PTSP.Views-3.3.csproj

    r13202 r13412  
    8484      <Private>False</Private>
    8585    </Reference>
     86    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     87      <SpecificVersion>False</SpecificVersion>
     88      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
     89      <Private>False</Private>
     90    </Reference>
    8691    <Reference Include="System" />
    8792    <Reference Include="System.Core" />
  • branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/PathPTSPTourView.cs

    r12306 r13412  
    2222using System;
    2323using System.Drawing;
    24 using System.Windows.Forms;
    2524using HeuristicLab.Core.Views;
    2625using HeuristicLab.Data;
     
    156155      }
    157156    }
    158 
    159157    private void Content_ProbabilitiesChanged(object sender, EventArgs e) {
    160158      if (InvokeRequired)
  • branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/Plugin.cs.frame

    r12317 r13412  
    1 using HeuristicLab.PluginInfrastructure;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 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 HeuristicLab.PluginInfrastructure;
     23
    224namespace HeuristicLab.Problems.PTSP.Views {
    3     [Plugin("HeuristicLab.Problems.PTSP.Views", "3.3.11.$WCREV$")]
    4     [PluginFile("HeuristicLab.Problems.PTSP.Views-3.3.dll", PluginFileType.Assembly)]
    5   [PluginDependency("HeuristicLab.Common", "3.3")]
    6   [PluginDependency("HeuristicLab.Core", "3.3")]
    7   [PluginDependency("HeuristicLab.Core.Views", "3.3")]
    8   [PluginDependency("HeuristicLab.Data", "3.3")]
    9   [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
    10   [PluginDependency("HeuristicLab.MainForm", "3.3")]
    11   [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
    12   [PluginDependency("HeuristicLab.Optimization", "3.3")]
    13   [PluginDependency("HeuristicLab.Optimization.Views", "3.3")]
    14   [PluginDependency("HeuristicLab.Parameters", "3.3")]
    15   [PluginDependency("HeuristicLab.Problems.PTSP", "3.3")]
    16     public class Plugin : PluginBase {
    17     }
     25  [Plugin("HeuristicLab.Problems.PTSP.Views", "3.3.13.$WCREV$")]
     26  [PluginFile("HeuristicLab.Problems.PTSP.Views-3.3.dll", PluginFileType.Assembly)]
     27  [PluginDependency("HeuristicLab.Common", "3.3")]
     28  [PluginDependency("HeuristicLab.Core", "3.3")]
     29  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
     30  [PluginDependency("HeuristicLab.Data", "3.3")]
     31  [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
     32  [PluginDependency("HeuristicLab.MainForm", "3.3")]
     33  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
     34  [PluginDependency("HeuristicLab.Optimization", "3.3")]
     35  [PluginDependency("HeuristicLab.Optimization.Views", "3.3")]
     36  [PluginDependency("HeuristicLab.Parameters", "3.3")]
     37  [PluginDependency("HeuristicLab.Problems.PTSP", "3.3")]
     38  [PluginDependency("HeuristicLab.Random", "3.3")]
     39  public class HeuristicLabProblemsPTSPViewsPlugin : PluginBase {
     40  }
    1841}
  • branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/ProbabilisticTravelingSalesmanProblemView.cs

    r12269 r13412  
    2121
    2222using System;
    23 using System.Windows.Forms;
     23using HeuristicLab.Data;
    2424using HeuristicLab.MainForm;
    2525using HeuristicLab.Optimization.Views;
    26 using HeuristicLab.Problems.PTSP;
    27 using HeuristicLab.Data;
     26using HeuristicLab.Random;
    2827
    2928namespace HeuristicLab.Problems.PTSP.Views {
     
    4039
    4140    /// <summary>
    42     /// Initializes a new instance of <see cref="ProbabilisticTravelingSalesmanView"/>.
     41    /// Initializes a new instance of <see cref="ProbabilisticTravelingSalesmanProblemView"/>.
    4342    /// </summary>
    4443    public ProbabilisticTravelingSalesmanProblemView() {
     
    4746
    4847    protected override void DeregisterContentEvents() {
    49       Content.CoordinatesParameter.ValueChanged -= new EventHandler(CoordinatesParameter_ValueChanged);
    50       Content.ProbabilityMatrixParameter.ValueChanged -= new EventHandler(ProbabilityParameter_ValueChanged);
    51       //Content.BestKnownQualityParameter.ValueChanged -= new EventHandler(BestKnownQualityParameter_ValueChanged);
    52       Content.BestKnownSolutionParameter.ValueChanged -= new EventHandler(BestKnownSolutionParameter_ValueChanged);
     48      Content.CoordinatesParameter.ValueChanged -= CoordinatesParameter_ValueChanged;
     49      Content.ProbabilitiesParameter.ValueChanged -= ProbabilityParameter_ValueChanged;
     50      Content.BestKnownSolutionParameter.ValueChanged -= BestKnownSolutionParameter_ValueChanged;
    5351      base.DeregisterContentEvents();
    5452    }
    5553    protected override void RegisterContentEvents() {
    5654      base.RegisterContentEvents();
    57       Content.CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged);
    58       Content.ProbabilityMatrixParameter.ValueChanged += new EventHandler(ProbabilityParameter_ValueChanged);
    59       //Content.BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged);
    60       Content.BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged);
     55      Content.CoordinatesParameter.ValueChanged += CoordinatesParameter_ValueChanged;
     56      Content.ProbabilitiesParameter.ValueChanged += ProbabilityParameter_ValueChanged;
     57      Content.BestKnownSolutionParameter.ValueChanged += BestKnownSolutionParameter_ValueChanged;
    6158    }
    6259    protected override void OnContentChanged() {
     
    6562        pathPTSPTourView.Content = null;
    6663      } else {
    67         pathPTSPTourView.Content = new PathPTSPTour(Content.Coordinates, Content.ProbabilityMatrix, Content.BestKnownSolution, new DoubleValue(Content.BestKnownQuality));
     64        pathPTSPTourView.Content = new PathPTSPTour(Content.Coordinates, Content.Probabilities, Content.BestKnownSolution, new DoubleValue(Content.BestKnownQuality));
    6865      }
    6966    }
     
    7774      pathPTSPTourView.Content.Coordinates = Content.Coordinates;
    7875    }
    79 
    8076    private void ProbabilityParameter_ValueChanged(object sender, EventArgs e) {
    81       pathPTSPTourView.Content.Probabilities = Content.ProbabilityMatrix;
    82     }
    83     private void BestKnownQualityParameter_ValueChanged(object sender, EventArgs e) {
    84       pathPTSPTourView.Content.Quality = new DoubleValue(Content.BestKnownQuality);
     77      pathPTSPTourView.Content.Probabilities = Content.Probabilities;
    8578    }
    8679    private void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) {
    8780      pathPTSPTourView.Content.Permutation = Content.BestKnownSolution;
     81      pathPTSPTourView.Content.Quality = new DoubleValue(Content.Evaluate(Content.BestKnownSolution, new MersenneTwister()));
    8882    }
    8983  }
Note: See TracChangeset for help on using the changeset viewer.