Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/HeuristicLab.Problems.Instances.TSPLIB-3.3.csproj
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/HeuristicLab.Problems.Instances.TSPLIB-3.3.csproj	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/HeuristicLab.Problems.Instances.TSPLIB-3.3.csproj	(revision 13412)
@@ -0,0 +1,181 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.Instances.TSPLIB</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.Instances.TSPLIB-3.3</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <CodeAnalysisLogFile>..\..\bin\HeuristicLab.Problems.Instances.TSPLIB-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <CodeAnalysisLogFile>..\..\bin\HeuristicLab.Problems.Instances.TSPLIB-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>..\..\bin\HeuristicLab.Problems.Instances.TSPLIB-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>..\..\bin\HeuristicLab.Problems.Instances.TSPLIB-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.IO.Compression" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="MarsagliaRandom.cs" />
+    <Compile Include="TSPLIBHeterogeneousPTSPDataDescriptor.cs" />
+    <Compile Include="TSPLIBHomogeneousPTSPDataDescriptor.cs" />
+    <Compile Include="TSPLIBHeterogeneousPTSPInstanceProvider.cs" />
+    <Compile Include="TSPLIBInstanceProvider.cs" />
+    <Compile Include="TSPLIBATSPInstanceProvider.cs" />
+    <Compile Include="TSPLIBCVRPInstanceProvider.cs" />
+    <Compile Include="TSPLIBDataDescriptor.cs" />
+    <Compile Include="TSPLIBHomogeneousPTSPInstanceProvider.cs" />
+    <Compile Include="TSPLIBTSPInstanceProvider.cs" />
+    <Compile Include="TSPLIBParser.cs" />
+    <EmbeddedResource Include="Data\atsp.zip" />
+    <EmbeddedResource Include="Data\tsp.zip" />
+    <EmbeddedResource Include="Data\tsp.opt.tour.zip" />
+    <EmbeddedResource Include="Data\vrp.zip" />
+    <None Include="Plugin.cs.frame" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
+      <Project>{3540e29e-4793-49e7-8ee2-fea7f61c3994}</Project>
+      <Name>HeuristicLab.Problems.Instances-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+  <PropertyGroup>
+    <PostBuildEvent>
+    </PostBuildEvent>
+  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/MarsagliaRandom.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/MarsagliaRandom.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/MarsagliaRandom.cs	(revision 13412)
@@ -0,0 +1,56 @@
+﻿
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  /// <summary>
+  /// This class is used to randomly generate PTSP instances given the TSPLIB instances.
+  /// An own implementation of a RNG was used in order to avoid possible implementation changes
+  /// in future .NET versions which would result in entirely different instances.
+  /// </summary>
+  internal class MarsagliaRandom {
+    /*
+     * S = 2111111111*X[n-4] + 1492*X[n-3] + 1776*X[n-2] + 5115*X[n-1] + C
+     * X[n] = S modulo 2^32
+     * C = floor(S / 2^32)
+     * 
+     */
+    private readonly uint[] mem = new uint[4];
+    private uint c;
+
+    public MarsagliaRandom(uint s) {
+      Seed(s);
+    }
+
+    private uint Next() {
+      unchecked {
+        ulong wsum = 2111111111 * mem[0]
+                    + 1492 * mem[1]
+                    + 1776 * mem[2]
+                    + 5115 * mem[3]
+                    + c;
+
+        mem[0] = mem[1];
+        mem[1] = mem[2];
+        mem[2] = mem[3];
+        mem[3] = (uint)wsum;
+        c = (uint)(wsum >> 32);
+        return mem[3];
+      }
+    }
+
+    public double NextDouble() {
+      return (double)Next() / uint.MaxValue;
+    }
+
+    public void Seed(uint seed) {
+      int i;
+      for (i = 0; i < mem.Length; i++) {
+        unchecked {
+          seed = seed * 31294061 + 1;
+        }
+        mem[i] = seed;
+      }
+      unchecked {
+        c = seed * 31294061 + 1;
+      }
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/Plugin.cs.frame
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/Plugin.cs.frame	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/Plugin.cs.frame	(revision 13412)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  [Plugin("HeuristicLab.Problems.Instances.TSPLIB", "3.3.13.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.Instances.TSPLIB-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
+  public class HeuristicLabProblemsInstancesTSPLIBPlugin : PluginBase {
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/Properties/AssemblyInfo.cs.frame	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/Properties/AssemblyInfo.cs.frame	(revision 13412)
@@ -0,0 +1,57 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.Instances.TSPLIB")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HEAL")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2015 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7c14407e-6980-465b-ba3a-4a916d48989b")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.13.$WCREV$")]
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBATSPInstanceProvider.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBATSPInstanceProvider.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBATSPInstanceProvider.cs	(revision 13412)
@@ -0,0 +1,59 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  public class TSPLIBATSPInstanceProvider : TSPLIBInstanceProvider<ATSPData> {
+
+    public override string Name {
+      get { return "TSPLIB (asymmetric TSP)"; }
+    }
+
+    public override string Description {
+      get { return "Traveling Salesman Problem Library"; }
+    }
+
+    protected override string FileExtension { get { return "atsp"; } }
+
+    protected override ATSPData LoadInstance(TSPLIBParser parser, IDataDescriptor descriptor = null) {
+      var instance = new ATSPData();
+
+      parser.Parse();
+      instance.Dimension = parser.Dimension;
+      instance.Coordinates = parser.DisplayVertices != null ? parser.DisplayVertices : parser.Vertices;
+      instance.Distances = parser.Distances;
+
+      instance.Name = parser.Name;
+      instance.Description = parser.Comment
+        + Environment.NewLine + Environment.NewLine
+        + GetInstanceDescription();
+
+      return instance;
+    }
+
+    protected override void LoadSolution(TSPLIBParser parser, ATSPData instance) {
+      parser.Parse();
+      instance.BestKnownTour = parser.Tour.FirstOrDefault();
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBCVRPInstanceProvider.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBCVRPInstanceProvider.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBCVRPInstanceProvider.cs	(revision 13412)
@@ -0,0 +1,81 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.IO;
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  public class TSPLIBCVRPInstanceProvider : TSPLIBInstanceProvider<CVRPData> {
+
+    public override string Name {
+      get { return "TSPLIB (CVRP)"; }
+    }
+
+    public override string Description {
+      get { return "Traveling Salesman Problem Library"; }
+    }
+
+    protected override string FileExtension { get { return "vrp"; } }
+
+    protected override CVRPData LoadInstance(TSPLIBParser parser, IDataDescriptor descriptor = null) {
+      parser.Parse();
+      var instance = new CVRPData();
+      instance.Dimension = parser.Dimension;
+      instance.Coordinates = parser.Vertices != null ? parser.Vertices : parser.DisplayVertices;
+      instance.Distances = parser.Distances;
+      instance.Capacity = parser.Capacity.Value;
+      instance.Demands = parser.Demands;
+      switch (parser.EdgeWeightType) {
+        case TSPLIBEdgeWeightTypes.ATT:
+          instance.DistanceMeasure = DistanceMeasure.Att; break;
+        case TSPLIBEdgeWeightTypes.CEIL_2D:
+          instance.DistanceMeasure = DistanceMeasure.UpperEuclidean; break;
+        case TSPLIBEdgeWeightTypes.EUC_2D:
+        case TSPLIBEdgeWeightTypes.EUC_3D:
+          instance.DistanceMeasure = DistanceMeasure.RoundedEuclidean; break;
+        case TSPLIBEdgeWeightTypes.EXPLICIT:
+          instance.DistanceMeasure = DistanceMeasure.Direct; break;
+        case TSPLIBEdgeWeightTypes.GEO:
+          instance.DistanceMeasure = DistanceMeasure.Geo; break;
+        case TSPLIBEdgeWeightTypes.MAN_2D:
+        case TSPLIBEdgeWeightTypes.MAN_3D:
+          instance.DistanceMeasure = DistanceMeasure.Manhattan; break;
+        case TSPLIBEdgeWeightTypes.MAX_2D:
+        case TSPLIBEdgeWeightTypes.MAX_3D:
+          instance.DistanceMeasure = DistanceMeasure.Maximum; break;
+        default:
+          throw new InvalidDataException("The given edge weight is not supported by HeuristicLab.");
+      }
+
+      instance.Name = parser.Name;
+      instance.Description = parser.Comment
+        + Environment.NewLine + Environment.NewLine
+        + GetInstanceDescription();
+
+      return instance;
+    }
+
+    protected override void LoadSolution(TSPLIBParser parser, CVRPData instance) {
+      parser.Parse();
+      instance.BestKnownTour = parser.Tour;
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBDataDescriptor.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBDataDescriptor.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBDataDescriptor.cs	(revision 13412)
@@ -0,0 +1,37 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  internal class TSPLIBDataDescriptor : IDataDescriptor {
+    public string Name { get; internal set; }
+    public string Description { get; internal set; }
+
+    internal string InstanceIdentifier { get; set; }
+    internal string SolutionIdentifier { get; set; }
+
+    internal TSPLIBDataDescriptor(string name, string description, string instanceIdentifier, string solutionIdentifier) {
+      this.Name = name;
+      this.Description = description;
+      this.InstanceIdentifier = instanceIdentifier;
+      this.SolutionIdentifier = solutionIdentifier;
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHeterogeneousPTSPDataDescriptor.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHeterogeneousPTSPDataDescriptor.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHeterogeneousPTSPDataDescriptor.cs	(revision 13412)
@@ -0,0 +1,36 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  internal class TSPLIBHeterogeneousPTSPDataDescriptor : TSPLIBDataDescriptor {
+    public int Seed { get; internal set; }
+
+    internal TSPLIBHeterogeneousPTSPDataDescriptor(string name, string description, string instanceIdentifier, string solutionIdentifier, int seed)
+      : base(name, description, instanceIdentifier, solutionIdentifier) {
+      this.Name = name;
+      this.Description = description;
+      this.InstanceIdentifier = instanceIdentifier;
+      this.SolutionIdentifier = solutionIdentifier;
+      this.Seed = seed;
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHeterogeneousPTSPInstanceProvider.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHeterogeneousPTSPInstanceProvider.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHeterogeneousPTSPInstanceProvider.cs	(revision 13412)
@@ -0,0 +1,108 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  public class TSPLIBHeterogeneousPTSPInstanceProvider : TSPLIBInstanceProvider<PTSPData> {
+
+    public override string Name {
+      get { return "TSPLIB (heterogeneous symmetric PTSP)"; }
+    }
+
+    public override string Description {
+      get { return "Traveling Salesman Problem Library"; }
+    }
+
+    protected override string FileExtension { get { return "tsp"; } }
+
+    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
+      foreach (var desc in base.GetDataDescriptors().OfType<TSPLIBDataDescriptor>()) {
+        desc.Name += " [0.1;0.9]";
+        desc.SolutionIdentifier = null;
+        yield return desc;
+      }
+    }
+
+    protected override PTSPData LoadInstance(TSPLIBParser parser, IDataDescriptor descriptor = null) {
+      parser.Parse();
+      if (parser.FixedEdges != null) throw new InvalidDataException("TSP instance " + parser.Name + " contains fixed edges which are not supported by HeuristicLab.");
+      var instance = new PTSPData();
+      instance.Dimension = parser.Dimension;
+      instance.Coordinates = parser.Vertices != null ? parser.Vertices : parser.DisplayVertices;
+      instance.Distances = parser.Distances;
+      switch (parser.EdgeWeightType) {
+        case TSPLIBEdgeWeightTypes.ATT:
+          instance.DistanceMeasure = DistanceMeasure.Att; break;
+        case TSPLIBEdgeWeightTypes.CEIL_2D:
+          instance.DistanceMeasure = DistanceMeasure.UpperEuclidean; break;
+        case TSPLIBEdgeWeightTypes.EUC_2D:
+          instance.DistanceMeasure = DistanceMeasure.RoundedEuclidean; break;
+        case TSPLIBEdgeWeightTypes.EUC_3D:
+          throw new InvalidDataException("3D coordinates are not supported.");
+        case TSPLIBEdgeWeightTypes.EXPLICIT:
+          instance.DistanceMeasure = DistanceMeasure.Direct; break;
+        case TSPLIBEdgeWeightTypes.GEO:
+          instance.DistanceMeasure = DistanceMeasure.Geo; break;
+        case TSPLIBEdgeWeightTypes.MAN_2D:
+          instance.DistanceMeasure = DistanceMeasure.Manhattan; break;
+        case TSPLIBEdgeWeightTypes.MAN_3D:
+          throw new InvalidDataException("3D coordinates are not supported.");
+        case TSPLIBEdgeWeightTypes.MAX_2D:
+          instance.DistanceMeasure = DistanceMeasure.Maximum; break;
+        case TSPLIBEdgeWeightTypes.MAX_3D:
+          throw new InvalidDataException("3D coordinates are not supported.");
+        default:
+          throw new InvalidDataException("The given edge weight is not supported by HeuristicLab.");
+      }
+
+      instance.Name = parser.Name;
+      instance.Description = parser.Comment
+        + Environment.NewLine + Environment.NewLine
+        + GetInstanceDescription();
+
+      var random = new MarsagliaRandom((uint)(descriptor != null ? descriptor.Name : instance.Name).GetHashCode());
+      instance.Probabilities = Enumerable.Range(0, instance.Dimension).Select(_ => 0.1 + 0.9 * random.NextDouble()).ToArray();
+
+      return instance;
+    }
+
+    protected override void LoadSolution(TSPLIBParser parser, PTSPData instance) {
+      parser.Parse();
+      instance.BestKnownTour = parser.Tour.FirstOrDefault();
+    }
+
+    public PTSPData LoadData(string tspFile, string tourFile, double? bestQuality) {
+      var data = LoadInstance(new TSPLIBParser(tspFile));
+      if (!String.IsNullOrEmpty(tourFile)) {
+        var tourParser = new TSPLIBParser(tourFile);
+        LoadSolution(tourParser, data);
+      }
+      if (bestQuality.HasValue)
+        data.BestKnownQuality = bestQuality.Value;
+      return data;
+    }
+
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHomogeneousPTSPDataDescriptor.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHomogeneousPTSPDataDescriptor.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHomogeneousPTSPDataDescriptor.cs	(revision 13412)
@@ -0,0 +1,35 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  internal class TSPLIBHomogeneousPTSPDataDescriptor : TSPLIBDataDescriptor {
+    public double Probability { get; internal set; }
+
+    internal TSPLIBHomogeneousPTSPDataDescriptor(string name, string description, string instanceIdentifier, string solutionIdentifier, double probability)
+      : base(name, description, instanceIdentifier, solutionIdentifier) {
+      this.Name = name;
+      this.Description = description;
+      this.InstanceIdentifier = instanceIdentifier;
+      this.SolutionIdentifier = solutionIdentifier;
+      this.Probability = probability;
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHomogeneousPTSPInstanceProvider.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHomogeneousPTSPInstanceProvider.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBHomogeneousPTSPInstanceProvider.cs	(revision 13412)
@@ -0,0 +1,116 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  public class TSPLIBHomogeneousPTSPInstanceProvider : TSPLIBInstanceProvider<PTSPData> {
+    private static readonly double[] probabilities = new[] { 0.1, 0.2, 0.4, 0.5, 0.6, 0.8, 0.9, 1.0 };
+
+    public override string Name {
+      get { return "TSPLIB (homogeneous symmetric PTSP)"; }
+    }
+
+    public override string Description {
+      get { return "Traveling Salesman Problem Library"; }
+    }
+
+    protected override string FileExtension { get { return "tsp"; } }
+
+    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
+      var tspDescriptors = base.GetDataDescriptors().OfType<TSPLIBDataDescriptor>();
+      foreach (var desc in tspDescriptors) {
+        foreach (var p in probabilities) {
+          yield return new TSPLIBHomogeneousPTSPDataDescriptor(
+            desc.Name + "-" + p.ToString(CultureInfo.InvariantCulture.NumberFormat),
+            desc.Description,
+            desc.InstanceIdentifier,
+            p == 1.0 ? desc.SolutionIdentifier : null,
+            p);
+        }
+      }
+    }
+
+    protected override PTSPData LoadInstance(TSPLIBParser parser, IDataDescriptor descriptor = null) {
+      parser.Parse();
+      if (parser.FixedEdges != null) throw new InvalidDataException("TSP instance " + parser.Name + " contains fixed edges which are not supported by HeuristicLab.");
+      var instance = new PTSPData();
+      instance.Dimension = parser.Dimension;
+      instance.Coordinates = parser.Vertices != null ? parser.Vertices : parser.DisplayVertices;
+      instance.Distances = parser.Distances;
+      switch (parser.EdgeWeightType) {
+        case TSPLIBEdgeWeightTypes.ATT:
+          instance.DistanceMeasure = DistanceMeasure.Att; break;
+        case TSPLIBEdgeWeightTypes.CEIL_2D:
+          instance.DistanceMeasure = DistanceMeasure.UpperEuclidean; break;
+        case TSPLIBEdgeWeightTypes.EUC_2D:
+          instance.DistanceMeasure = DistanceMeasure.RoundedEuclidean; break;
+        case TSPLIBEdgeWeightTypes.EUC_3D:
+          throw new InvalidDataException("3D coordinates are not supported.");
+        case TSPLIBEdgeWeightTypes.EXPLICIT:
+          instance.DistanceMeasure = DistanceMeasure.Direct; break;
+        case TSPLIBEdgeWeightTypes.GEO:
+          instance.DistanceMeasure = DistanceMeasure.Geo; break;
+        case TSPLIBEdgeWeightTypes.MAN_2D:
+          instance.DistanceMeasure = DistanceMeasure.Manhattan; break;
+        case TSPLIBEdgeWeightTypes.MAN_3D:
+          throw new InvalidDataException("3D coordinates are not supported.");
+        case TSPLIBEdgeWeightTypes.MAX_2D:
+          instance.DistanceMeasure = DistanceMeasure.Maximum; break;
+        case TSPLIBEdgeWeightTypes.MAX_3D:
+          throw new InvalidDataException("3D coordinates are not supported.");
+        default:
+          throw new InvalidDataException("The given edge weight is not supported by HeuristicLab.");
+      }
+
+      instance.Name = parser.Name;
+      instance.Description = parser.Comment
+        + Environment.NewLine + Environment.NewLine
+        + GetInstanceDescription();
+      var ptspDesc = descriptor as TSPLIBHomogeneousPTSPDataDescriptor;
+      instance.Probabilities = ptspDesc != null ? Enumerable.Range(0, instance.Dimension).Select(_ => ptspDesc.Probability).ToArray()
+                                                : Enumerable.Range(0, instance.Dimension).Select(_ => 0.5).ToArray();
+
+      return instance;
+    }
+
+    protected override void LoadSolution(TSPLIBParser parser, PTSPData instance) {
+      parser.Parse();
+      instance.BestKnownTour = parser.Tour.FirstOrDefault();
+    }
+
+    public PTSPData LoadData(string tspFile, string tourFile, double? bestQuality) {
+      var data = LoadInstance(new TSPLIBParser(tspFile));
+      if (!String.IsNullOrEmpty(tourFile)) {
+        var tourParser = new TSPLIBParser(tourFile);
+        LoadSolution(tourParser, data);
+      }
+      if (bestQuality.HasValue)
+        data.BestKnownQuality = bestQuality.Value;
+      return data;
+    }
+
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBInstanceProvider.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBInstanceProvider.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBInstanceProvider.cs	(revision 13412)
@@ -0,0 +1,108 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using System.Reflection;
+using System.Text.RegularExpressions;
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  public abstract class TSPLIBInstanceProvider<T> : ProblemInstanceProvider<T> {
+
+    public override Uri WebLink {
+      get { return new Uri("http://comopt.ifi.uni-heidelberg.de/software/TSPLIB95/"); }
+    }
+
+    public override string ReferencePublication {
+      get {
+        return @"G. Reinelt. 1991.
+TSPLIB - A Traveling Salesman Problem Library.
+ORSA Journal on Computing, 3, pp. 376-384.";
+      }
+    }
+
+    protected abstract string FileExtension { get; }
+
+    protected abstract T LoadInstance(TSPLIBParser parser, IDataDescriptor descriptor = null);
+    protected abstract void LoadSolution(TSPLIBParser parser, T instance);
+
+    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
+      Dictionary<string, string> solutions = new Dictionary<string, string>();
+      var solutionsArchiveName = GetResourceName(FileExtension + @"\.opt\.tour\.zip");
+      if (!String.IsNullOrEmpty(solutionsArchiveName)) {
+        using (var solutionsZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName), ZipArchiveMode.Read)) {
+          foreach (var entry in solutionsZipFile.Entries)
+            solutions.Add(entry.Name.Substring(0, entry.Name.Length - ".opt.tour".Length) + "." + FileExtension, entry.Name);
+        }
+      }
+      var instanceArchiveName = GetResourceName(FileExtension + @"\.zip");
+      if (String.IsNullOrEmpty(instanceArchiveName)) yield break;
+
+      using (var instanceStream = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) {
+        foreach (var entry in instanceStream.Entries.Select(x => x.Name).OrderBy(x => x)) {
+          yield return new TSPLIBDataDescriptor(Path.GetFileNameWithoutExtension(entry), GetInstanceDescription(), entry, solutions.ContainsKey(entry) ? solutions[entry] : String.Empty);
+        }
+      }
+    }
+
+    public override T LoadData(IDataDescriptor id) {
+      var descriptor = (TSPLIBDataDescriptor)id;
+      var instanceArchiveName = GetResourceName(FileExtension + @"\.zip");
+      using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) {
+        var entry = instancesZipFile.GetEntry(descriptor.InstanceIdentifier);
+        var stream = entry.Open();
+        var parser = new TSPLIBParser(stream);
+        var instance = LoadInstance(parser, id);
+
+        if (!String.IsNullOrEmpty(descriptor.SolutionIdentifier)) {
+          var solutionsArchiveName = GetResourceName(FileExtension + @"\.opt\.tour\.zip");
+          using (var solutionsZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName), ZipArchiveMode.Read)) {
+            entry = solutionsZipFile.GetEntry(descriptor.SolutionIdentifier);
+            stream = entry.Open();
+            parser = new TSPLIBParser(stream);
+            LoadSolution(parser, instance);
+          }
+        }
+
+        return instance;
+      }
+    }
+
+    public override bool CanImportData {
+      get { return true; }
+    }
+    public override T ImportData(string path) {
+      return LoadInstance(new TSPLIBParser(path));
+    }
+
+    protected virtual string GetResourceName(string fileName) {
+      return Assembly.GetExecutingAssembly().GetManifestResourceNames()
+              .Where(x => Regex.Match(x, @".*\.Data\." + fileName).Success).SingleOrDefault();
+    }
+
+    protected virtual string GetInstanceDescription() {
+      return "Embedded instance of plugin version " + Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true).Cast<AssemblyFileVersionAttribute>().First().Version + ".";
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBParser.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBParser.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBParser.cs	(revision 13412)
@@ -0,0 +1,590 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+
+  #region Public Enums
+  public enum TSPLIBTypes {
+    UNKNOWN = 0,
+    TSP = 1,
+    ATSP = 2,
+    SOP = 3,
+    HCP = 4,
+    CVRP = 5,
+    TOUR = 6
+  }
+
+  public enum TSPLIBEdgeWeightTypes {
+    UNKNOWN = 0,
+    EXPLICIT = 1,
+    EUC_2D = 2,
+    EUC_3D = 3,
+    MAX_2D = 4,
+    MAX_3D = 5,
+    MAN_2D = 6,
+    MAN_3D = 7,
+    CEIL_2D = 8,
+    GEO = 9,
+    ATT = 10,
+    XRAY1 = 11,
+    XRAY2 = 12,
+    SPECIAL = 13
+  }
+
+  public enum TSPLIBDisplayDataTypes {
+    UNKNOWN = 0,
+    COORD_DISPLAY = 1,
+    TWOD_DISPLAY = 2,
+    NO_DISPLAY = 3
+  }
+  #endregion
+
+  public class TSPLIBParser {
+
+    public string Name { get; private set; }
+    public TSPLIBTypes Type { get; private set; }
+    public string Comment { get; private set; }
+    public int Dimension { get; private set; }
+    public double? Capacity { get; private set; }
+    public TSPLIBEdgeWeightTypes EdgeWeightType { get; private set; }
+    public TSPLIBDisplayDataTypes DisplayDataType { get; private set; }
+    public double[,] Vertices { get; private set; }
+    public double[,] DisplayVertices { get; private set; }
+    public double[,] Distances { get; private set; }
+    public int[,] FixedEdges { get; private set; }
+    public int[] Depots { get; private set; }
+    public double[] Demands { get; private set; }
+    public int[][] Tour { get; private set; }
+
+    private static readonly char sectionSeparator = ':';
+    private static readonly char[] itemSeparator = new char[] { ' ', '\t' };
+
+    #region Private Enums
+    private enum TSPLIBSections {
+      UNKNOWN = 0,
+      EOF = 1,
+      NAME = 2,
+      TYPE = 3,
+      COMMENT = 4,
+      DIMENSION = 5,
+      CAPACITY = 6,
+      EDGE_WEIGHT_TYPE = 7,
+      EDGE_WEIGHT_FORMAT = 8,
+      EDGE_DATA_FORMAT = 9,
+      NODE_COORD_TYPE = 10,
+      DISPLAY_DATA_TYPE = 11,
+      NODE_COORD_SECTION = 12,
+      DEPOT_SECTION = 13,
+      DEMAND_SECTION = 14,
+      EDGE_DATA_SECTION = 15,
+      FIXED_EDGES_SECTION = 16,
+      DISPLAY_DATA_SECTION = 17,
+      TOUR_SECTION = 18,
+      EDGE_WEIGHT_SECTION = 19
+    }
+    private enum TSPLIBEdgeWeightFormats {
+      UNKNWON = 0,
+      FUNCTION = 1,
+      FULL_MATRIX = 2,
+      UPPER_ROW = 3,
+      LOWER_ROW = 4,
+      UPPER_DIAG_ROW = 5,
+      LOWER_DIAG_ROW = 6,
+      UPPER_COL = 7,
+      LOWER_COL = 8,
+      UPPER_DIAG_COL = 9,
+      LOWER_DIAG_COL = 10
+    }
+    private enum TSPLIBEdgeWeightDataFormats {
+      UNKNOWN = 0,
+      EDGE_LIST = 1,
+      ADJ_LIST = 2
+    }
+    private enum TSLPLIBNodeCoordTypes {
+      UNKNOWN = 0,
+      TWOD_COORDS = 1,
+      THREED_COORDS = 2,
+      NO_COORDS = 3
+    }
+    #endregion
+
+    private StreamReader source;
+    private int currentLineNumber;
+
+    private TSPLIBEdgeWeightFormats edgeWeightFormat;
+    private TSPLIBEdgeWeightDataFormats edgeWeightDataFormat;
+    private TSLPLIBNodeCoordTypes nodeCoordType;
+    private TSPLIBDisplayDataTypes displayDataType;
+
+    private TSPLIBParser() {
+      Name = String.Empty;
+      Comment = String.Empty;
+      Type = TSPLIBTypes.UNKNOWN;
+      EdgeWeightType = TSPLIBEdgeWeightTypes.UNKNOWN;
+
+      edgeWeightFormat = TSPLIBEdgeWeightFormats.UNKNWON;
+      edgeWeightDataFormat = TSPLIBEdgeWeightDataFormats.UNKNOWN;
+      nodeCoordType = TSLPLIBNodeCoordTypes.UNKNOWN;
+      displayDataType = TSPLIBDisplayDataTypes.UNKNOWN;
+    }
+
+    public TSPLIBParser(String path)
+      : this() {
+      source = new StreamReader(path);
+    }
+
+    public TSPLIBParser(Stream stream)
+      : this() {
+      source = new StreamReader(stream);
+    }
+
+    /// <summary>
+    /// Reads the TSPLIB file and parses the elements.
+    /// </summary>
+    /// <exception cref="InvalidDataException">Thrown if the file has an invalid format or contains invalid data.</exception>
+    public void Parse() {
+      TSPLIBSections section;
+      string line;
+      currentLineNumber = 0;
+
+      try {
+        do {
+          line = NextLine();
+          string value;
+          section = GetSection(line, out value);
+
+          switch (section) {
+            case TSPLIBSections.UNKNOWN:
+              break;
+            case TSPLIBSections.NAME:
+              ReadName(value);
+              break;
+            case TSPLIBSections.TYPE:
+              ReadType(value);
+              break;
+            case TSPLIBSections.COMMENT:
+              ReadComment(value);
+              break;
+            case TSPLIBSections.DIMENSION:
+              ReadDimension(value);
+              break;
+            case TSPLIBSections.CAPACITY:
+              ReadCapacity(value);
+              break;
+            case TSPLIBSections.EDGE_WEIGHT_TYPE:
+              ReadEdgeWeightType(value);
+              break;
+            case TSPLIBSections.EDGE_WEIGHT_FORMAT:
+              ReadEdgeWeightFormat(value);
+              break;
+            case TSPLIBSections.EDGE_DATA_FORMAT:
+              ReadEdgeWeightDataFormat(value);
+              break;
+            case TSPLIBSections.NODE_COORD_TYPE:
+              ReadNodeCoordType(value);
+              break;
+            case TSPLIBSections.DISPLAY_DATA_TYPE:
+              ReadDisplayDataType(value);
+              break;
+            case TSPLIBSections.NODE_COORD_SECTION:
+              ReadNodeCoordsSection();
+              break;
+            case TSPLIBSections.DEPOT_SECTION:
+              ReadDepotSection();
+              break;
+            case TSPLIBSections.DEMAND_SECTION:
+              ReadDemandSection();
+              break;
+            case TSPLIBSections.EDGE_DATA_SECTION:
+              ReadEdgeDataSection();
+              break;
+            case TSPLIBSections.FIXED_EDGES_SECTION:
+              ReadFixedEdgesSection();
+              break;
+            case TSPLIBSections.DISPLAY_DATA_SECTION:
+              ReadDisplayDataSection();
+              break;
+            case TSPLIBSections.TOUR_SECTION:
+              ReadTourSection();
+              break;
+            case TSPLIBSections.EDGE_WEIGHT_SECTION:
+              ReadEdgeWeightSection();
+              break;
+            case TSPLIBSections.EOF:
+              break;
+            default:
+              throw new InvalidDataException("Input file contains unknown or unsupported section (" + line + ") in line " + currentLineNumber.ToString());
+          }
+        } while (!(section == TSPLIBSections.EOF || source.EndOfStream));
+      } finally {
+        source.Close();
+      }
+    }
+
+    private string NextLine() {
+      currentLineNumber++;
+      return source.ReadLine();
+    }
+
+    private TSPLIBSections GetSection(string line, out string value) {
+      value = String.Empty;
+
+      if (line == null)
+        return TSPLIBSections.UNKNOWN;
+
+      int sectionNameEnd = line.IndexOf(sectionSeparator);
+      if (sectionNameEnd == -1) sectionNameEnd = line.Length;
+
+      string sectionName = line.Substring(0, sectionNameEnd).Trim();
+      if (sectionNameEnd + 1 < line.Length)
+        value = line.Substring(sectionNameEnd + 1);
+
+      TSPLIBSections section;
+      if (Enum.TryParse(sectionName, out section)) {
+        return section;
+      } else return TSPLIBSections.UNKNOWN;
+    }
+
+    private void ReadName(string value) {
+      Name += value.Trim();
+    }
+
+    private void ReadType(string value) {
+      TSPLIBTypes t;
+      if (Enum.TryParse(value.Trim().ToUpper(), out t))
+        Type = t;
+      else Type = TSPLIBTypes.UNKNOWN;
+    }
+
+    private void ReadComment(string value) {
+      Comment += value.Trim() + Environment.NewLine;
+    }
+
+    private void ReadCapacity(string value) {
+      double c;
+      if (double.TryParse(value.Trim(), NumberStyles.Any, CultureInfo.InvariantCulture.NumberFormat, out c))
+        Capacity = c;
+      else throw new InvalidDataException("Parsing the capacity in line " + currentLineNumber + " failed. It is not recognized as double value.");
+    }
+
+    private void ReadDimension(string value) {
+      int dimension;
+      if (int.TryParse(value.Trim(), out dimension))
+        Dimension = dimension;
+      else throw new InvalidDataException("Parsing the dimension in line " + currentLineNumber + " failed. It is not recognized as an integer number.");
+    }
+
+    private void ReadEdgeWeightType(string value) {
+      TSPLIBEdgeWeightTypes e;
+      if (Enum.TryParse(value.Trim().ToUpper(), out e))
+        EdgeWeightType = e;
+      else throw new InvalidDataException("Input file contains an unsupported edge weight type (" + value + ") in line " + currentLineNumber + ".");
+    }
+
+    private void ReadEdgeWeightFormat(string value) {
+      TSPLIBEdgeWeightFormats e;
+      if (Enum.TryParse(value.Trim().ToUpper(), out e))
+        edgeWeightFormat = e;
+      else throw new InvalidDataException("Input file contains an unsupported edge weight format (" + value + ") in line " + currentLineNumber + ".");
+    }
+
+    private void ReadEdgeWeightDataFormat(string value) {
+      TSPLIBEdgeWeightDataFormats e;
+      if (Enum.TryParse(value.Trim().ToUpper(), out e))
+        edgeWeightDataFormat = e;
+      else throw new InvalidDataException("Input file contains an unsupported edge weight data format (" + value + ") in line " + currentLineNumber + ".");
+    }
+
+    private void ReadNodeCoordType(string value) {
+      TSLPLIBNodeCoordTypes n;
+      if (Enum.TryParse(value.Trim().ToUpper(), out n))
+        nodeCoordType = n;
+      else throw new InvalidDataException("Input file contains an unsupported node coordinates type (" + value + ") in line " + currentLineNumber + ".");
+    }
+
+    private void ReadDisplayDataType(string value) {
+      TSPLIBDisplayDataTypes d;
+      if (Enum.TryParse(value.Trim().ToUpper(), out d))
+        displayDataType = d;
+      else throw new InvalidDataException("Input file contains an unsupported display data type (" + value + ") in line " + currentLineNumber + ".");
+    }
+
+    private void ReadNodeCoordsSection() {
+      if (Dimension == 0)
+        throw new InvalidDataException("Input file does not contain dimension information.");
+      switch (nodeCoordType) {
+        case TSLPLIBNodeCoordTypes.NO_COORDS:
+          return;
+        case TSLPLIBNodeCoordTypes.UNKNOWN: // It's a pity that there is a documented standard which is ignored in most files.
+        case TSLPLIBNodeCoordTypes.TWOD_COORDS:
+          Vertices = new double[Dimension, 2];
+          break;
+        case TSLPLIBNodeCoordTypes.THREED_COORDS:
+          Vertices = new double[Dimension, 3];
+          break;
+        default:
+          throw new InvalidDataException("Input files does not specify a valid node coord type.");
+      }
+
+      for (int i = 0; i < Dimension; i++) {
+        string line = NextLine();
+        string[] tokens = line.Split(itemSeparator, StringSplitOptions.RemoveEmptyEntries);
+
+        if (tokens.Length != Vertices.GetLength(1) + 1)
+          throw new InvalidDataException("Input file contains invalid number of node coordinates in line " + currentLineNumber + ".");
+
+        int node;
+        if (int.TryParse(tokens[0], out node)) {
+          for (int j = 0; j < Vertices.GetLength(1); j++)
+            Vertices[node - 1, j] = double.Parse(tokens[j + 1], CultureInfo.InvariantCulture.NumberFormat);
+        } else throw new InvalidDataException("Input file does not specify a valid node in line " + currentLineNumber + ".");
+      }
+    }
+
+    private void ReadDepotSection() {
+      var depots = new List<int>();
+      do {
+        string line = NextLine();
+        int node;
+        if (!int.TryParse(line, out node))
+          throw new InvalidDataException("Input file contains an unknown depot entry at line " + currentLineNumber + ".");
+        if (node == -1) break;
+        depots.Add(node);
+      } while (true);
+      Depots = depots.ToArray();
+    }
+
+    private void ReadDemandSection() {
+      if (Dimension == 0)
+        throw new InvalidDataException("Input file does not contain dimension information.");
+      Demands = new double[Dimension];
+      for (int i = 0; i < Dimension; i++) {
+        string[] tokens = NextLine().Split(itemSeparator, StringSplitOptions.RemoveEmptyEntries);
+        int node;
+        if (int.TryParse(tokens[0], out node)) {
+          double demand;
+          if (double.TryParse(tokens[1], NumberStyles.Any, CultureInfo.InvariantCulture.NumberFormat, out demand))
+            Demands[node - 1] = demand;
+          else throw new InvalidDataException("Input file contains invalid demand information in line " + currentLineNumber + ".");
+        } else throw new InvalidDataException("Input file contains invalid node information in line " + currentLineNumber + ".");
+      }
+    }
+
+    private void ReadEdgeDataSection() {
+      throw new NotSupportedException("Files with an edge data section are not supported.");
+    }
+
+    private void ReadFixedEdgesSection() {
+      var edges = new List<Tuple<int, int>>();
+      bool finished = false;
+      while (!finished) {
+        string line = NextLine();
+        string[] tokens = line.Split(itemSeparator, StringSplitOptions.RemoveEmptyEntries);
+        if (tokens.Length == 1) {
+          int number;
+          if (!int.TryParse(tokens[0], NumberStyles.Integer, CultureInfo.InvariantCulture.NumberFormat, out number))
+            throw new InvalidDataException("Input file does not end the fixed edges section with \"-1\" in line " + currentLineNumber + ".");
+          if (number != -1)
+            throw new InvalidDataException("Input file must end the fixed edges section with a -1 in line " + currentLineNumber + ".");
+          finished = true;
+        } else {
+          if (tokens.Length != 2)
+            throw new InvalidDataException("Input file contains an error in line " + currentLineNumber + ", exactly two nodes need to be given in each line.");
+          int node1 = int.Parse(tokens[0], CultureInfo.InvariantCulture.NumberFormat) - 1;
+          int node2 = int.Parse(tokens[1], CultureInfo.InvariantCulture.NumberFormat) - 1;
+          edges.Add(Tuple.Create(node1, node2));
+        }
+      }
+      FixedEdges = new int[edges.Count, 2];
+      for (int i = 0; i < edges.Count; i++) {
+        FixedEdges[i, 0] = edges[i].Item1;
+        FixedEdges[i, 1] = edges[i].Item2;
+      }
+    }
+
+    private void ReadDisplayDataSection() {
+      if (Dimension == 0)
+        throw new InvalidDataException("Input file does not contain dimension information.");
+
+      switch (displayDataType) {
+        case TSPLIBDisplayDataTypes.NO_DISPLAY:
+        case TSPLIBDisplayDataTypes.COORD_DISPLAY:
+          return;
+        case TSPLIBDisplayDataTypes.TWOD_DISPLAY:
+          DisplayVertices = new double[Dimension, 2];
+          break;
+        default:
+          throw new InvalidDataException("Input files does not specify a valid display data type.");
+      }
+
+      for (int i = 0; i < Dimension; i++) {
+        string line = NextLine();
+        string[] tokens = line.Split(itemSeparator, StringSplitOptions.RemoveEmptyEntries);
+
+        if (tokens.Length != DisplayVertices.GetLength(1) + 1)
+          throw new InvalidDataException("Input file contains invalid number of display data coordinates in line " + currentLineNumber + ".");
+
+        int node;
+        if (int.TryParse(tokens[0], out node)) {
+          for (int j = 0; j < DisplayVertices.GetLength(1); j++)
+            DisplayVertices[node - 1, j] = double.Parse(tokens[j + 1], CultureInfo.InvariantCulture.NumberFormat);
+        } else throw new InvalidDataException("Input file does not specify a valid node in line " + currentLineNumber + ".");
+      }
+    }
+
+    /// <summary>
+    /// Parses the tour section.
+    /// </summary>
+    /// <remarks>
+    /// Unfortunately, none of the given files for the TSP follow the description
+    /// in the TSPLIB documentation.
+    /// The faulty files use only one -1 to terminate the section as well as the tour
+    /// whereas the documentation says that one -1 terminates the tour and another -1
+    /// terminates the section.
+    /// So the parser peeks at the next character after a -1. If the next character
+    /// is an E as in EOF or the stream ends, the parser ends. Otherwise it will
+    /// continue to read tours until a -1 is followed by a -1.
+    /// </remarks>
+    private void ReadTourSection() {
+      if (Dimension == 0)
+        throw new InvalidDataException("Input file does not contain dimension information.");
+
+      var tours = new List<List<int>>();
+      do {
+        var line = NextLine();
+        if (String.IsNullOrEmpty(line)) break;
+        string[] nodes = line.Split(itemSeparator, StringSplitOptions.RemoveEmptyEntries);
+        if (!nodes.Any()) break;
+
+        bool finished = false;
+        foreach (var nodeString in nodes) {
+          int node = int.Parse(nodeString, CultureInfo.InvariantCulture.NumberFormat);
+          if (node == -1) {
+            finished = (tours.Any() && tours.Last().Count == 0) // -1 followed by -1
+              || (source.BaseStream.CanSeek && source.Peek() == -1)
+              || source.Peek() == (int)'E';
+            if (finished) break;
+            tours.Add(new List<int>());
+          } else {
+            if (!tours.Any()) tours.Add(new List<int>());
+            tours.Last().Add(node - 1);
+          }
+        }
+        if (finished) break;
+      } while (true);
+      if (tours.Last().Count == 0) tours.RemoveAt(tours.Count - 1);
+      Tour = tours.Select(x => x.ToArray()).ToArray();
+    }
+
+    private void ReadEdgeWeightSection() {
+      if (Dimension == 0)
+        throw new InvalidDataException("Input file does not contain dimension information.");
+
+      if (edgeWeightFormat == TSPLIBEdgeWeightFormats.UNKNWON)
+        throw new InvalidDataException("Input file does not specify an edge weight format.");
+
+      if (edgeWeightFormat == TSPLIBEdgeWeightFormats.FUNCTION)
+        return;
+
+      Distances = new double[Dimension, Dimension];
+
+      bool triangular = edgeWeightFormat != TSPLIBEdgeWeightFormats.FULL_MATRIX;
+      bool upperTriangular = edgeWeightFormat == TSPLIBEdgeWeightFormats.UPPER_COL
+        || edgeWeightFormat == TSPLIBEdgeWeightFormats.UPPER_DIAG_COL
+        || edgeWeightFormat == TSPLIBEdgeWeightFormats.UPPER_DIAG_ROW
+        || edgeWeightFormat == TSPLIBEdgeWeightFormats.UPPER_ROW;
+      bool diagonal = edgeWeightFormat == TSPLIBEdgeWeightFormats.LOWER_DIAG_COL
+        || edgeWeightFormat == TSPLIBEdgeWeightFormats.LOWER_DIAG_ROW
+        || edgeWeightFormat == TSPLIBEdgeWeightFormats.UPPER_DIAG_COL
+        || edgeWeightFormat == TSPLIBEdgeWeightFormats.UPPER_DIAG_ROW;
+      bool rowWise = edgeWeightFormat == TSPLIBEdgeWeightFormats.LOWER_DIAG_ROW
+        || edgeWeightFormat == TSPLIBEdgeWeightFormats.LOWER_ROW
+        || edgeWeightFormat == TSPLIBEdgeWeightFormats.UPPER_DIAG_ROW
+        || edgeWeightFormat == TSPLIBEdgeWeightFormats.UPPER_ROW;
+
+      int dim1 = triangular && !upperTriangular ? (diagonal ? 0 : 1) : 0;
+      int dim2 = triangular && upperTriangular ? (diagonal ? 0 : 1) : 0;
+      bool finished = false;
+      while (!finished) {
+        string line = NextLine();
+        string[] weights = line.Split(itemSeparator, StringSplitOptions.RemoveEmptyEntries);
+        foreach (var weightString in weights) {
+          double weight;
+          if (!double.TryParse(weightString, NumberStyles.Any, CultureInfo.InvariantCulture.NumberFormat, out weight))
+            throw new InvalidDataException("Input file contains unreadable weight information (" + weightString + ") in line " + currentLineNumber + ".");
+
+          if (triangular) {
+            Distances[dim1, dim2] = weight;
+            Distances[dim2, dim1] = weight;
+            if (upperTriangular) {
+              if (rowWise) {
+                dim2++;
+                if (dim2 == Dimension) {
+                  dim1++;
+                  if (diagonal) dim2 = dim1;
+                  else dim2 = dim1 + 1;
+                }
+              } else { // column-wise
+                dim1++;
+                if (diagonal && dim1 == dim2 + 1
+                  || !diagonal && dim1 == dim2) {
+                  dim2++;
+                  dim1 = 0;
+                }
+              }
+            } else { // lower-triangular
+              if (rowWise) {
+                dim2++;
+                if (diagonal && dim2 == dim1 + 1
+                  || !diagonal && dim2 == dim1) {
+                  dim1++;
+                  dim2 = 0;
+                }
+              } else { // column-wise
+                dim1++;
+                if (dim1 == Dimension) {
+                  dim2++;
+                  if (diagonal) dim1 = dim2;
+                  else dim1 = dim2 + 1;
+                }
+              }
+            }
+          } else { // full-matrix
+            Distances[dim1, dim2] = weight;
+            dim2++;
+            if (dim2 == Dimension) {
+              dim1++;
+              dim2 = 0;
+            }
+          }
+        }
+        finished = dim1 == Dimension || dim2 == Dimension;
+      }
+    }
+
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBTSPInstanceProvider.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBTSPInstanceProvider.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBTSPInstanceProvider.cs	(revision 13412)
@@ -0,0 +1,95 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.IO;
+using System.Linq;
+
+namespace HeuristicLab.Problems.Instances.TSPLIB {
+  public class TSPLIBTSPInstanceProvider : TSPLIBInstanceProvider<TSPData> {
+
+    public override string Name {
+      get { return "TSPLIB (symmetric TSP)"; }
+    }
+
+    public override string Description {
+      get { return "Traveling Salesman Problem Library"; }
+    }
+
+    protected override string FileExtension { get { return "tsp"; } }
+
+    protected override TSPData LoadInstance(TSPLIBParser parser, IDataDescriptor descriptor = null) {
+      parser.Parse();
+      if (parser.FixedEdges != null) throw new InvalidDataException("TSP instance " + parser.Name + " contains fixed edges which are not supported by HeuristicLab.");
+      var instance = new TSPData();
+      instance.Dimension = parser.Dimension;
+      instance.Coordinates = parser.Vertices != null ? parser.Vertices : parser.DisplayVertices;
+      instance.Distances = parser.Distances;
+      switch (parser.EdgeWeightType) {
+        case TSPLIBEdgeWeightTypes.ATT:
+          instance.DistanceMeasure = DistanceMeasure.Att; break;
+        case TSPLIBEdgeWeightTypes.CEIL_2D:
+          instance.DistanceMeasure = DistanceMeasure.UpperEuclidean; break;
+        case TSPLIBEdgeWeightTypes.EUC_2D:
+          instance.DistanceMeasure = DistanceMeasure.RoundedEuclidean; break;
+        case TSPLIBEdgeWeightTypes.EUC_3D:
+          throw new InvalidDataException("3D coordinates are not supported.");
+        case TSPLIBEdgeWeightTypes.EXPLICIT:
+          instance.DistanceMeasure = DistanceMeasure.Direct; break;
+        case TSPLIBEdgeWeightTypes.GEO:
+          instance.DistanceMeasure = DistanceMeasure.Geo; break;
+        case TSPLIBEdgeWeightTypes.MAN_2D:
+          instance.DistanceMeasure = DistanceMeasure.Manhattan; break;
+        case TSPLIBEdgeWeightTypes.MAN_3D:
+          throw new InvalidDataException("3D coordinates are not supported.");
+        case TSPLIBEdgeWeightTypes.MAX_2D:
+          instance.DistanceMeasure = DistanceMeasure.Maximum; break;
+        case TSPLIBEdgeWeightTypes.MAX_3D:
+          throw new InvalidDataException("3D coordinates are not supported.");
+        default:
+          throw new InvalidDataException("The given edge weight is not supported by HeuristicLab.");
+      }
+
+      instance.Name = parser.Name;
+      instance.Description = parser.Comment
+        + Environment.NewLine + Environment.NewLine
+        + GetInstanceDescription();
+      return instance;
+    }
+
+    protected override void LoadSolution(TSPLIBParser parser, TSPData instance) {
+      parser.Parse();
+      instance.BestKnownTour = parser.Tour.FirstOrDefault();
+    }
+
+    public TSPData LoadData(string tspFile, string tourFile, double? bestQuality) {
+      var data = LoadInstance(new TSPLIBParser(tspFile));
+      if (!String.IsNullOrEmpty(tourFile)) {
+        var tourParser = new TSPLIBParser(tourFile);
+        LoadSolution(tourParser, data);
+      }
+      if (bestQuality.HasValue)
+        data.BestKnownQuality = bestQuality.Value;
+      return data;
+    }
+
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj	(revision 13412)
@@ -0,0 +1,184 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.Instances</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.Instances-3.3</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <CodeAnalysisLogFile>..\..\bin\HeuristicLab.Problems.Instances-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <CodeAnalysisLogFile>..\..\bin\HeuristicLab.Problems.Instances-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>..\..\bin\HeuristicLab.Problems.Instances-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>..\..\bin\HeuristicLab.Problems.Instances-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Plugin.cs.frame" />
+    <Compile Include="ProblemInstanceManager.cs" />
+    <Compile Include="IProblemInstanceExporter.cs" />
+    <Compile Include="Types\PTSPData.cs" />
+    <Compile Include="Types\ATSPData.cs" />
+    <Compile Include="Types\JSSPData.cs" />
+    <Compile Include="Types\CTAPData.cs" />
+    <Compile Include="IDataDescriptor.cs" />
+    <Compile Include="Types\DistanceHelper.cs" />
+    <Compile Include="Types\OPData.cs" />
+    <Compile Include="Types\VRP\MDCVRPTWData.cs" />
+    <Compile Include="Types\VRP\MDCVRPData.cs" />
+    <Compile Include="Types\VRP\PDPTWData.cs" />
+    <Compile Include="Types\VRP\CVRPTWData.cs" />
+    <Compile Include="Types\VRP\VRPData.cs" />
+    <Compile Include="Types\VRP\CVRPData.cs" />
+    <Compile Include="Types\GQAPData.cs" />
+    <Compile Include="Types\VRP\IVRPData.cs" />
+    <Compile Include="Types\QAPData.cs" />
+    <Compile Include="Types\TSPData.cs" />
+    <Compile Include="IProblemInstanceConsumer.cs" />
+    <Compile Include="IProblemInstanceProvider.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="ProblemInstanceProvider.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+  <PropertyGroup>
+    <PostBuildEvent>
+    </PostBuildEvent>
+  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IDataDescriptor.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IDataDescriptor.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IDataDescriptor.cs	(revision 13412)
@@ -0,0 +1,27 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances {
+  public interface IDataDescriptor {
+    string Name { get; }
+    string Description { get; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceConsumer.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceConsumer.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceConsumer.cs	(revision 13412)
@@ -0,0 +1,35 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.Instances {
+  public interface IProblemInstanceConsumer : IContent { }
+
+  public interface IProblemInstanceConsumer<in TData> : IProblemInstanceConsumer {
+    /// <summary>
+    /// Loads the given instance data.
+    /// </summary>
+    /// <exception cref="InvalidDataException">Thrown when the instance cannot be loaded.</exception>
+    /// <param name="data">The data of the instance.</param>
+    void Load(TData data);
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceExporter.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceExporter.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceExporter.cs	(revision 13412)
@@ -0,0 +1,28 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances {
+  public interface IProblemInstanceExporter { }
+
+  public interface IProblemInstanceExporter<TData> : IProblemInstanceExporter {
+    TData Export();
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceProvider.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceProvider.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceProvider.cs	(revision 13412)
@@ -0,0 +1,44 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.Instances {
+  public interface IProblemInstanceProvider : IContent {
+    string Name { get; }
+    string Description { get; }
+    Uri WebLink { get; }
+    string ReferencePublication { get; }
+  }
+
+  public interface IProblemInstanceProvider<TData> : IProblemInstanceProvider {
+    IEnumerable<IDataDescriptor> GetDataDescriptors();
+    TData LoadData(IDataDescriptor descriptor);
+
+    bool CanImportData { get; }
+    TData ImportData(string path);
+
+    bool CanExportData { get; }
+    void ExportData(TData instance, string path);
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Plugin.cs.frame
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Plugin.cs.frame	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Plugin.cs.frame	(revision 13412)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.Instances {
+  [Plugin("HeuristicLab.Problems.Instances", "3.3.13.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.Instances-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  public class HeuristicLabProblemsInstancesPlugin : PluginBase {
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/ProblemInstanceManager.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/ProblemInstanceManager.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/ProblemInstanceManager.cs	(revision 13412)
@@ -0,0 +1,62 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.Instances {
+  public class ProblemInstanceManager {
+    public static IEnumerable<IProblemInstanceProvider> GetProviders(object item) {
+      var consumerTypes = item.GetType().GetInterfaces()
+        .Where(x => x.IsGenericType
+          && x.GetGenericTypeDefinition() == typeof(IProblemInstanceConsumer<>));
+
+      if (consumerTypes.Any()) {
+        var instanceTypes = consumerTypes
+          .Select(x => x.GetGenericArguments().First())
+          .Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x));
+
+        var interfaceTypes = instanceTypes.Where(x => x.GetGenericArguments().First().IsInterface);
+        if (interfaceTypes.Any()) {
+          var concreteTypes = interfaceTypes.SelectMany(x => ApplicationManager.Manager.GetTypes(x.GetGenericArguments().First()));
+
+          if (concreteTypes.Any())
+            instanceTypes = instanceTypes.Union(concreteTypes.Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x))).Distinct();
+        }
+
+        foreach (var type in instanceTypes) {
+          foreach (var provider in ApplicationManager.Manager.GetInstances(type))
+            yield return (IProblemInstanceProvider)provider;
+        }
+      }
+    }
+
+    public static IEnumerable<IDataDescriptor> GetDataDescriptors(IProblemInstanceProvider provider) {
+      IEnumerable<IDataDescriptor> descriptors = ((dynamic)provider).GetDataDescriptors();
+      return descriptors;
+    }
+
+    public static void LoadData(IProblemInstanceProvider provider, IDataDescriptor descriptor, IProblemInstanceConsumer consumer) {
+      ((dynamic)consumer).Load(((dynamic)provider).LoadData(descriptor));
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/ProblemInstanceProvider.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/ProblemInstanceProvider.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/ProblemInstanceProvider.cs	(revision 13412)
@@ -0,0 +1,50 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Problems.Instances {
+  public abstract class ProblemInstanceProvider<TData> : IProblemInstanceProvider<TData> {
+    public abstract string Name { get; }
+    public abstract string Description { get; }
+    public abstract Uri WebLink { get; }
+    public abstract string ReferencePublication { get; }
+
+    public abstract IEnumerable<IDataDescriptor> GetDataDescriptors();
+
+    public abstract TData LoadData(IDataDescriptor descriptor);
+
+    public virtual bool CanImportData {
+      get { return false; }
+    }
+    public virtual TData ImportData(string path) {
+      throw new NotSupportedException();
+    }
+
+    public virtual bool CanExportData {
+      get { return false; }
+    }
+    public virtual void ExportData(TData instance, string path) {
+      throw new NotSupportedException();
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Properties/AssemblyInfo.cs.frame	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Properties/AssemblyInfo.cs.frame	(revision 13412)
@@ -0,0 +1,57 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.Instances")]
+[assembly: AssemblyDescription("Base plugin for making problem instances available to problems.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HEAL")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2015 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7c14407e-6980-465b-ba3a-4a916d48989b")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.13.$WCREV$")]
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/ATSPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/ATSPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/ATSPData.cs	(revision 13412)
@@ -0,0 +1,63 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describe instances of the Asymmetric Traveling Salesman Problem (ATSP).
+  /// </summary>
+  public class ATSPData {
+    /// <summary>
+    /// The name of the instance
+    /// </summary>
+    public string Name { get; set; }
+    /// <summary>
+    /// Optional! The description of the instance
+    /// </summary>
+    public string Description { get; set; }
+
+    /// <summary>
+    /// The number of cities.
+    /// </summary>
+    public int Dimension { get; set; }
+    /// <summary>
+    /// The distances are given in form of a distance matrix.
+    /// </summary>
+    public double[,] Distances { get; set; }
+    /// <summary>
+    /// Optional! A a matrix of dimension [N, 2] where each row is one of the cities
+    /// and the colmns represent x and y coordinates respectively.
+    /// </summary>
+    /// <remarks>
+    /// The coordinates are for display purposes only.
+    /// </remarks>
+    public double[,] Coordinates { get; set; }
+
+    /// <summary>
+    /// Optional! The best-known tour in path-encoding.
+    /// </summary>
+    public int[] BestKnownTour { get; set; }
+    /// <summary>
+    /// Optional! The quality of the best-known tour.
+    /// </summary>
+    public double? BestKnownQuality { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/CTAPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/CTAPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/CTAPData.cs	(revision 13412)
@@ -0,0 +1,70 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Capacitated Task Assignment Problem (CTAP).
+  /// </summary>
+  public class CTAPData {
+    /// <summary>
+    /// The name of the instance
+    /// </summary>
+    public string Name { get; set; }
+    /// <summary>
+    /// Optional! The description of the instance
+    /// </summary>
+    public string Description { get; set; }
+
+    /// <summary>
+    /// The number M of processors
+    /// </summary>
+    public int Processors { get; set; }
+    /// <summary>
+    /// The number N of tasks
+    /// </summary>
+    public int Tasks { get; set; }
+    /// <summary>
+    /// An MxN Matrix with M = |Processors| and N = |Tasks|
+    /// </summary>
+    public double[,] ExecutionCosts { get; set; }
+    /// <summary>
+    /// An NxN Matrix with N = |Tasks|
+    /// </summary>
+    public double[,] CommunicationCosts { get; set; }
+    /// <summary>
+    /// An array of length N with N = |Tasks|
+    /// </summary>
+    public double[] MemoryRequirements { get; set; }
+    /// <summary>
+    /// An array of length M with M = |Processors|
+    /// </summary>
+    public double[] MemoryCapacities { get; set; }
+
+    /// <summary>
+    /// Optional! An array of length N with N = |Tasks|
+    /// </summary>
+    public int[] BestKnownAssignment { get; set; }
+    /// <summary>
+    /// Optional! The quality value of the <see cref="BestKnownAssignment"/>
+    /// </summary>
+    public double? BestKnownQuality { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/DistanceHelper.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/DistanceHelper.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/DistanceHelper.cs	(revision 13412)
@@ -0,0 +1,133 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Problems.Instances {
+  public enum DistanceMeasure { Direct, Euclidean, RoundedEuclidean, UpperEuclidean, Geo, Manhattan, Maximum, Att };
+
+  public static class DistanceHelper {
+    /// <summary>
+    /// If only the coordinates are given, can calculate the distance matrix.
+    /// </summary>
+    /// <returns>A full distance matrix between all cities.</returns>
+    public static double[,] GetDistanceMatrix(DistanceMeasure distanceMeasure, double[,] coordinates, double[,] distances, int dimension) {
+      if (distances != null) return distances;
+
+      distances = new double[dimension, dimension];
+      for (int i = 0; i < dimension - 1; i++)
+        for (int j = i + 1; j < dimension; j++) {
+          distances[i, j] = GetDistance(i, j, distanceMeasure, coordinates, distances);
+          distances[j, i] = distances[i, j];
+        }
+
+      return distances;
+    }
+
+    public static double GetDistance(DistanceMeasure distanceMeasure, double x1, double y1, double x2, double y2) {
+      switch (distanceMeasure) {
+        case DistanceMeasure.Att:
+          return AttDistance(x1, y1, x2, y2);
+        case DistanceMeasure.Direct:
+          throw new ArgumentException("Direct distance measure requires distance matrix for distance calculation.");
+        case DistanceMeasure.Euclidean:
+          return EuclideanDistance(x1, y1, x2, y2);
+        case DistanceMeasure.Geo:
+          return GeoDistance(x1, y1, x2, y2);
+        case DistanceMeasure.Manhattan:
+          return ManhattanDistance(x1, y1, x2, y2);
+        case DistanceMeasure.Maximum:
+          return MaximumDistance(x1, y1, x2, y2);
+        case DistanceMeasure.RoundedEuclidean:
+          return Math.Round(EuclideanDistance(x1, y1, x2, y2));
+        case DistanceMeasure.UpperEuclidean:
+          return Math.Ceiling(EuclideanDistance(x1, y1, x2, y2));
+        default:
+          throw new InvalidOperationException("Distance measure is not known.");
+      }
+    }
+
+    #region Private Helpers
+    private static double GetDistance(int i, int j, DistanceMeasure distanceMeasure, double[,] coordinates, double[,] distances) {
+      switch (distanceMeasure) {
+        case DistanceMeasure.Att:
+          return AttDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]);
+        case DistanceMeasure.Direct:
+          return distances[i, j];
+        case DistanceMeasure.Euclidean:
+          return EuclideanDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]);
+        case DistanceMeasure.Geo:
+          return GeoDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]);
+        case DistanceMeasure.Manhattan:
+          return ManhattanDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]);
+        case DistanceMeasure.Maximum:
+          return MaximumDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]);
+        case DistanceMeasure.RoundedEuclidean:
+          return Math.Round(EuclideanDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]));
+        case DistanceMeasure.UpperEuclidean:
+          return Math.Ceiling(EuclideanDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]));
+        default:
+          throw new InvalidOperationException("Distance measure is not known.");
+      }
+    }
+
+    private static double AttDistance(double x1, double y1, double x2, double y2) {
+      return Math.Ceiling(Math.Sqrt(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) / 10.0));
+    }
+
+    private static double EuclideanDistance(double x1, double y1, double x2, double y2) {
+      return Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
+    }
+
+    private const double PI = 3.141592;
+    private const double RADIUS = 6378.388;
+    private static double GeoDistance(double x1, double y1, double x2, double y2) {
+      double latitude1, longitude1, latitude2, longitude2;
+      double q1, q2, q3;
+      double length;
+
+      latitude1 = ConvertToRadian(x1);
+      longitude1 = ConvertToRadian(y1);
+      latitude2 = ConvertToRadian(x2);
+      longitude2 = ConvertToRadian(y2);
+
+      q1 = Math.Cos(longitude1 - longitude2);
+      q2 = Math.Cos(latitude1 - latitude2);
+      q3 = Math.Cos(latitude1 + latitude2);
+
+      length = (int)(RADIUS * Math.Acos(0.5 * ((1.0 + q1) * q2 - (1.0 - q1) * q3)) + 1.0);
+      return (length);
+    }
+
+    private static double ConvertToRadian(double x) {
+      return PI * (Math.Truncate(x) + 5.0 * (x - Math.Truncate(x)) / 3.0) / 180.0;
+    }
+
+    private static double ManhattanDistance(double x1, double y1, double x2, double y2) {
+      return Math.Round(Math.Abs(x1 - x2) + Math.Abs(y1 - y2), MidpointRounding.AwayFromZero);
+    }
+
+    private static double MaximumDistance(double x1, double y1, double x2, double y2) {
+      return Math.Max(Math.Round(Math.Abs(x1 - x2), MidpointRounding.AwayFromZero), Math.Round(Math.Abs(y1 - y2), MidpointRounding.AwayFromZero));
+    }
+    #endregion
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/GQAPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/GQAPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/GQAPData.cs	(revision 13412)
@@ -0,0 +1,78 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes an instance of the Generalized Quadratic Assignment Problem (GQAP).
+  /// </summary>
+  public class GQAPData {
+    /// <summary>
+    /// The name of the instance.
+    /// </summary>
+    public string Name { get; set; }
+    /// <summary>
+    /// A description of the instance.
+    /// </summary>
+    public string Description { get; set; }
+
+    /// <summary>
+    /// |E| = The number of equipments are to be assigned in this instance.
+    /// </summary>
+    public int Equipments { get; set; }
+    /// <summary>
+    /// |L| = The number of locations that are available for the equipments.
+    /// </summary>
+    public int Locations { get; set; }
+    /// <summary>
+    /// Vector of length |E| that describes the space demand for the equipments.
+    /// </summary>
+    public double[] Demands { get; set; }
+    /// <summary>
+    /// Vector of length |L| that describes the space capacity for the locations.
+    /// </summary>
+    public double[] Capacities { get; set; }
+    /// <summary>
+    /// |E|x|E| matrix with the weights (flows) between the equipments. These describe the strength of the respective bonding.
+    /// </summary>
+    public double[,] Weights { get; set; }
+    /// <summary>
+    /// |L|x|L| matrix with the distances between the locations.
+    /// </summary>
+    public double[,] Distances { get; set; }
+    /// <summary>
+    /// |E|x|L| matrix that describes the costs of installing equipment x at location y.
+    /// </summary>
+    public double[,] InstallationCosts { get; set; }
+    /// <summary>
+    /// A factor that scales the weights.
+    /// </summary>
+    public double TransportationCosts { get; set; }
+
+    /// <summary>
+    /// Optional! The best-known assignment is a vector of length |E| with numbers ranging from 0 to |L| - 1
+    /// </summary>
+    public int[] BestKnownAssignment { get; set; }
+    /// <summary>
+    /// Optional! The quality of the best-known assignment.
+    /// </summary>
+    public double? BestKnownQuality { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/JSSPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/JSSPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/JSSPData.cs	(revision 13412)
@@ -0,0 +1,68 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Job Shop Scheduling Problem (JSSP).
+  /// </summary>
+  public class JSSPData {
+    /// <summary>
+    /// The name of the instance
+    /// </summary>
+    public string Name { get; set; }
+    /// <summary>
+    /// Optional! The description of the instance
+    /// </summary>
+    public string Description { get; set; }
+
+    /// <summary>
+    /// The number of jobs.
+    /// </summary>
+    public int Jobs { get; set; }
+    /// <summary>
+    /// The number of resources.
+    /// </summary>
+    public int Resources { get; set; }
+    /// <summary>
+    /// The first dimension lists the jobs, the second dimension the operations and the value denotes the processing time.
+    /// </summary>
+    public double[,] ProcessingTimes { get; set; }
+    /// <summary>
+    /// The first dimension lists the jobs, the second dimension the operations and the value denotes the resource that is demanded.
+    /// </summary>
+    public int[,] Demands { get; set; }
+    /// <summary>
+    /// Optional! Specifies the due dates for each job.
+    /// </summary>
+    public double[] DueDates { get; set; }
+
+    /// <summary>
+    /// Optional! The best-known schedule.
+    /// The first dimension lists the resources, the second dimension is the order and the value denotes the job
+    /// </summary>
+    public int[,] BestKnownSchedule { get; set; }
+    /// <summary>
+    /// Optional! The quality of the best-known schedule.
+    /// </summary>
+    public double? BestKnownQuality { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/OPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/OPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/OPData.cs	(revision 13412)
@@ -0,0 +1,49 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances.Types {
+  /// <summary>
+  /// Describes instances of the Orienteering Problem (OP).
+  /// </summary>
+  public class OPData : TSPData {
+    /// <summary>
+    /// The maximum distance constraint for a Orienteering solution.
+    /// </summary>
+    public double MaximumDistance { get; set; }
+    /// <summary>
+    /// The scores of the points.
+    /// </summary>
+    public double[] Scores { get; set; }
+    /// <summary>
+    /// The penalty for each visited vertex.
+    /// </summary>
+    public double PointVisitingCosts { get; set; }
+    /// <summary>
+    /// Index of the starting point
+    /// </summary>
+    public int StartingPoint { get; set; }
+    /// <summary>
+    /// Index of the ending point.
+    /// </summary>
+    public int TerminalPoint { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/PTSPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/PTSPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/PTSPData.cs	(revision 13412)
@@ -0,0 +1,12 @@
+﻿
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Probabilistic Traveling Salesman Problem (PTSP).
+  /// </summary>
+  public class PTSPData : TSPData {
+    /// <summary>
+    /// The probabilities for each of the cities to appear in a route.
+    /// </summary>
+    public double[] Probabilities { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/QAPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/QAPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/QAPData.cs	(revision 13412)
@@ -0,0 +1,58 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Quadratic Assignment Problem (QAP).
+  /// </summary>
+  public class QAPData {
+    /// <summary>
+    /// The name of the instance
+    /// </summary>
+    public string Name { get; set; }
+    /// <summary>
+    /// Optional! The description of the instance
+    /// </summary>
+    public string Description { get; set; }
+
+    /// <summary>
+    /// The number of facilities (and also the number of locations)
+    /// </summary>
+    public int Dimension { get; set; }
+    /// <summary>
+    /// An NxN Matrix with N = |Faciliies|
+    /// </summary>
+    public double[,] Distances { get; set; }
+    /// <summary>
+    /// An NxN Matrix with N = |Faciliies|
+    /// </summary>
+    public double[,] Weights { get; set; }
+
+    /// <summary>
+    /// Optional! An array of length N with N = |Facilities|
+    /// </summary>
+    public int[] BestKnownAssignment { get; set; }
+    /// <summary>
+    /// Optional! The quality value of the <see cref="BestKnownAssignment"/>
+    /// </summary>
+    public double? BestKnownQuality { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/TSPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/TSPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/TSPData.cs	(revision 13412)
@@ -0,0 +1,84 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Traveling Salesman Problem (TSP).
+  /// </summary>
+  public class TSPData {
+    /// <summary>
+    /// The name of the instance
+    /// </summary>
+    public string Name { get; set; }
+    /// <summary>
+    /// Optional! The description of the instance
+    /// </summary>
+    public string Description { get; set; }
+
+    /// <summary>
+    /// The number of cities.
+    /// </summary>
+    public int Dimension { get; set; }
+    /// <summary>
+    /// Specifies the distance measure that is to be used.
+    /// </summary>
+    public DistanceMeasure DistanceMeasure { get; set; }
+    /// <summary>
+    /// Optional! The distances are given in form of a distance matrix.
+    /// </summary>
+    /// <remarks>
+    /// Either this property or <see cref="Coordinates"/> needs to be specified.
+    /// </remarks>
+    public double[,] Distances { get; set; }
+    /// <summary>
+    /// Optional! A a matrix of dimension [N, 2] matrix where each row is one of the cities
+    /// and the colmns represent x and y coordinates respectively.
+    /// </summary>
+    /// <remarks>
+    /// Either this property or <see cref="Distances"/> needs to be specified.
+    /// 
+    /// If no distance matrix is given, the distances have to be calculated by the
+    /// specified distance measure. If a distance matrix is given in addtion to the
+    /// coordinates, the distance matrix takes precedence and the coordinates are
+    /// for display only.
+    /// </remarks>
+    public double[,] Coordinates { get; set; }
+
+    /// <summary>
+    /// Optional! The best-known tour in path-encoding.
+    /// </summary>
+    public int[] BestKnownTour { get; set; }
+    /// <summary>
+    /// Optional! The quality of the best-known tour.
+    /// </summary>
+    public double? BestKnownQuality { get; set; }
+
+    /// <summary>
+    /// If only the coordinates are given, can calculate the distance matrix.
+    /// </summary>
+    /// <returns>A full distance matrix between all cities.</returns>
+    public double[,] GetDistanceMatrix() {
+      return DistanceHelper.GetDistanceMatrix(DistanceMeasure, Coordinates, Distances, Dimension);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPData.cs	(revision 13412)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Capacitated Vehicle Routing Problem (CVRP).
+  /// </summary>
+  public class CVRPData: VRPData {
+    /// <summary>
+    /// The capacity of the vehicles, which is the same for all (homogeneous fleet).
+    /// </summary>
+    public double Capacity { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPTWData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPTWData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPTWData.cs	(revision 13412)
@@ -0,0 +1,41 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Capacitated Vehicle Routing Problem with Time Windows (CVRPTW).
+  /// </summary>
+  public class CVRPTWData: CVRPData {
+    /// <summary>
+    /// The ready times of the customers and the depot
+    /// </summary>
+    public double[] ReadyTimes { get; set; }
+    /// <summary>
+    /// The service times of the customers and the depot
+    /// </summary>
+    public double[] ServiceTimes { get; set; }
+    /// <summary>
+    /// The due times of the customers and the depot
+    /// </summary>
+    public double[] DueTimes { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/IVRPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/IVRPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/IVRPData.cs	(revision 13412)
@@ -0,0 +1,35 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Interface for VRP data
+  /// </summary>
+  public interface IVRPData {
+    string Name { get; set; }
+    string Description { get; set; }
+    int Dimension { get; set; }
+    double? BestKnownQuality { get; set; }
+    int[][] BestKnownTour { get; set; }
+    int[] BestKnownTourVehicleAssignment { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPData.cs	(revision 13412)
@@ -0,0 +1,41 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Multi-Depot Capacitated Vehicle Routing Problem (MDCVRP).
+  /// </summary>
+  public class MDCVRPData: VRPData {
+    /// <summary>
+    /// The number of depots
+    /// </summary>
+    public int Depots { get; set; }
+    /// <summary>
+    /// The assignment of the vehicles to the depot.
+    /// </summary>
+    public int[] VehicleDepotAssignment { get; set; }
+    /// <summary>
+    /// The capacity of the vehicles, which is not the same for all (heterogeneous fleet).
+    /// </summary>
+    public double[] Capacity { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPTWData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPTWData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPTWData.cs	(revision 13412)
@@ -0,0 +1,41 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Multi-Depot Capacitated Vehicle Routing Problem (MDCVRP).
+  /// </summary>
+  public class MDCVRPTWData: MDCVRPData {
+    /// <summary>
+    /// The ready times of the customers and the depot
+    /// </summary>
+    public double[] ReadyTimes { get; set; }
+    /// <summary>
+    /// The service times of the customers and the depot
+    /// </summary>
+    public double[] ServiceTimes { get; set; }
+    /// <summary>
+    /// The due times of the customers and the depot
+    /// </summary>
+    public double[] DueTimes { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/PDPTWData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/PDPTWData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/PDPTWData.cs	(revision 13412)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Pickup and Delivery Problem with Time Windows (PDPTW).
+  /// </summary>
+  public class PDPTWData: CVRPTWData {
+    /// <summary>
+    /// The pickup and delivery locations of the requests
+    /// </summary>
+    public int[] PickupDeliveryLocations { get; set; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/VRPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/VRPData.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/VRP/VRPData.cs	(revision 13412)
@@ -0,0 +1,96 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+
+namespace HeuristicLab.Problems.Instances {
+  /// <summary>
+  /// Describes instances of the Vehicle Routing Problem (VRP).
+  /// </summary>
+  public class VRPData : IVRPData {
+    /// <summary>
+    /// The name of the instance
+    /// </summary>
+    public string Name { get; set; }
+    /// <summary>
+    /// Optional! The description of the instance
+    /// </summary>
+    public string Description { get; set; }
+
+    /// <summary>
+    /// The number of customers and the depot
+    /// </summary>
+    public int Dimension { get; set; }
+    /// <summary>
+    /// The distance measure that is used to calculate the distance between
+    ///the coordinates if no <see cref="Distances"/> is given.
+    /// </summary>
+    public DistanceMeasure DistanceMeasure { get; set; }
+    /// <summary>
+    /// Optional! The maximum number of vehicles that can be used.
+    /// </summary>
+    /// <remarks>
+    /// If no number is given, but a maximum is required, it can be assumed that
+    /// the maximum number of vehicles is equal to the number of customers as
+    /// there cannot be more than one vehicle per customer.
+    /// </remarks>
+    public double? MaximumVehicles { get; set; }
+    /// <remarks>
+    /// Either Distances or the <see cref="Coordinates"/> need to be specified along
+    /// with a distance measure.
+    /// </remarks>
+    public double[,] Distances { get; set; }
+    /// <summary>
+    /// Optional! A a matrix of dimension [N, 2] where each row is either the customer
+    /// or the depot and the columns represent x and y coordinates respectively.
+    /// </summary>
+    /// <remarks>
+    /// Either <see cref="Distances"/> or the Coordinates need to be specified along
+    /// with a distance measure.
+    /// </remarks>
+    public double[,] Coordinates { get; set; }
+    /// <summary>
+    /// The demand vector that specifies how many goods need to be delivered.
+    /// The vector has to include the depot, but with a demand of 0.
+    /// </summary>
+    public double[] Demands { get; set; }
+
+    /// <summary>
+    /// Optional! The best-known solution as a list of tours in path-encoding.
+    /// </summary>
+    public int[][] BestKnownTour { get; set; }
+    /// <summary>
+    /// Optional! Specifies the used vehicle for a given tour.
+    /// </summary>
+    public int[] BestKnownTourVehicleAssignment { get; set; }
+    /// <summary>
+    /// Optional! The quality of the best-known solution.
+    /// </summary>
+    public double? BestKnownQuality { get; set; }
+
+    /// <summary>
+    /// If only the coordinates are given, can calculate the distance matrix.
+    /// </summary>
+    /// <returns>A full distance matrix between all cities.</returns>
+    public double[,] GetDistanceMatrix() {
+      return DistanceHelper.GetDistanceMatrix(DistanceMeasure, Coordinates, Distances, Dimension);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP.Tests-3.3/PTSPMoveEvaluatorTest.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP.Tests-3.3/PTSPMoveEvaluatorTest.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP.Tests-3.3/PTSPMoveEvaluatorTest.cs	(revision 13412)
@@ -1,3 +1,24 @@
-﻿using System;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -6,7 +27,6 @@
 using HeuristicLab.Random;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.Diagnostics;
 
-namespace HeuristicLab.Problems.PTSP.Tests_3._3 {
+namespace HeuristicLab.Problems.PTSP.Tests {
   /// <summary>
   ///This is a test class for PTSP move evaluators
@@ -15,10 +35,11 @@
   public class PTSPMoveEvaluatorTest {
     private const int ProblemSize = 10;
+    private const int RealizationsSize = 100;
     private static DoubleMatrix coordinates;
     private static DistanceMatrix distances;
     private static Permutation tour;
     private static MersenneTwister random;
-    private static ItemList<ItemList<IntValue>> realizations;
-    private static DoubleArray ProbabilityMatrix;
+    private static ItemList<BoolArray> realizations;
+    private static DoubleArray probabilities;
 
     [ClassInitialize]
@@ -27,10 +48,10 @@
       coordinates = new DoubleMatrix(ProblemSize, 2);
       distances = new DistanceMatrix(ProblemSize, ProblemSize);
-      for (int i = 0; i < ProblemSize; i++) {
+      for (var i = 0; i < ProblemSize; i++) {
         coordinates[i, 0] = random.Next(ProblemSize * 10);
         coordinates[i, 1] = random.Next(ProblemSize * 10);
       }
-      for (int i = 0; i < ProblemSize - 1; i++) {
-        for (int j = i + 1; j < ProblemSize; j++) {
+      for (var i = 0; i < ProblemSize - 1; i++) {
+        for (var j = i + 1; j < ProblemSize; j++) {
           distances[i, j] = Math.Round(Math.Sqrt(Math.Pow(coordinates[i, 0] - coordinates[j, 0], 2) + Math.Pow(coordinates[i, 1] - coordinates[j, 1], 2)));
           distances[j, i] = distances[i, j];
@@ -38,27 +59,20 @@
       }
 
-      ProbabilityMatrix = new DoubleArray(ProblemSize);
-      for (int i = 0; i < ProblemSize; i++) {
-        ProbabilityMatrix[i] = random.NextDouble();
+      probabilities = new DoubleArray(ProblemSize);
+      for (var i = 0; i < ProblemSize; i++) {
+        probabilities[i] = random.NextDouble();
       }
 
-      int numRealizations = 100;
-      int countOnes = 0;
-      realizations = new ItemList<ItemList<IntValue>>(numRealizations);
-      for (int i = 0; i < numRealizations; i++) {
-        ItemList<IntValue> newRealization = new ItemList<IntValue>();
+      realizations = new ItemList<BoolArray>(RealizationsSize);
+      for (var i = 0; i < RealizationsSize; i++) {
+        var countOnes = 0;
+        var newRealization = new BoolArray(ProblemSize);
         while (countOnes < 4) { //only generate realizations with at least 4 cities visited
           countOnes = 0;
-          newRealization.Clear();
-          for (int j = 0; j < ProblemSize; j++) {
-            if (ProbabilityMatrix[j] > random.NextDouble()) {
-              newRealization.Add(new IntValue(1));
-              countOnes++;
-            } else {
-              newRealization.Add(new IntValue(0));
-            }
+          for (var j = 0; j < ProblemSize; j++) {
+            newRealization[j] = random.NextDouble() < probabilities[j];
+            if (newRealization[j]) countOnes++;
           }
         }
-        countOnes = 0;
         realizations.Add(newRealization);
       }
@@ -68,25 +82,19 @@
 
     [TestMethod]
-    [TestCategory("Problems.TravelingSalesman")]
+    [TestCategory("Problems.ProbabilisticTravelingSalesman")]
     [TestProperty("Time", "short")]
     public void InversionMoveEvaluatorTest() {
+      var beforeMatrix = EstimatedProbabilisticTravelingSalesmanProblem.Evaluate(tour, distances, realizations)[0];
 
-      EstimatedProbabilisticTravelingSalesmanProblem ePTSP = new EstimatedProbabilisticTravelingSalesmanProblem();
+      for (var i = 0; i < 500; i++) {
+        var move = StochasticInversionSingleMoveGenerator.Apply(tour, random);
+        var moveMatrix = PTSPEstimatedInversionMoveEvaluator.EvaluateByDistanceMatrix(tour, move, distances, realizations);
+        InversionManipulator.Apply(tour, move.Index1, move.Index2);
+        var afterMatrix = EstimatedProbabilisticTravelingSalesmanProblem.Evaluate(tour, distances, realizations)[0];
 
-      double beforeMatrix = ePTSP.EvaluateWithParams(distances, ProbabilityMatrix, realizations, tour)[0];
-
-      for (int i = 0; i < 500; i++) {
-        var move = StochasticInversionSingleMoveGenerator.Apply(tour, random);
-
-        double moveMatrix = PTSPEstimatedInversionEvaluator.EvaluateByDistanceMatrix(tour, move, distances,realizations);
-
-        string failureString = string.Format(@"Inversion move is calculated with quality {0}, but actual difference is {4}.
-The move would invert the tour {1} between values {2} and {3}.", moveMatrix.ToString(), tour.ToString(), tour[move.Index1].ToString(), tour[move.Index2].ToString(), "{0}");
-
-        InversionManipulator.Apply(tour, move.Index1, move.Index2);
-
-        double afterMatrix = ePTSP.EvaluateWithParams(distances, ProbabilityMatrix, realizations, tour)[0];
-
-        Assert.IsTrue(Math.Abs(moveMatrix).IsAlmost(Math.Abs(afterMatrix - beforeMatrix)), string.Format(failureString, (Math.Abs(afterMatrix - beforeMatrix)).ToString()));
+        Assert.IsTrue(Math.Abs(moveMatrix).IsAlmost(Math.Abs(afterMatrix - beforeMatrix)),
+          string.Format(@"Inversion move is calculated with quality {0}, but actual difference is {4}.
+The move would invert the tour {1} between values {2} and {3}.",
+          moveMatrix, tour, tour[move.Index1], tour[move.Index2], Math.Abs(afterMatrix - beforeMatrix)));
 
         beforeMatrix = afterMatrix;
@@ -95,25 +103,19 @@
 
     [TestMethod]
-    [TestCategory("Problems.TravelingSalesman")]
+    [TestCategory("Problems.ProbabilisticTravelingSalesman")]
     [TestProperty("Time", "short")]
     public void InsertionMoveEvaluatorTest() {
+      var beforeMatrix = EstimatedProbabilisticTravelingSalesmanProblem.Evaluate(tour, distances, realizations)[0];
 
-      EstimatedProbabilisticTravelingSalesmanProblem ePTSP = new EstimatedProbabilisticTravelingSalesmanProblem();
+      for (var i = 0; i < 500; i++) {
+        var move = StochasticTranslocationSingleMoveGenerator.Apply(tour, random);
+        var moveMatrix = PTSPEstimatedInsertionMoveEvaluator.EvaluateByDistanceMatrix(tour, move, distances, realizations);
+        TranslocationManipulator.Apply(tour, move.Index1, move.Index1, move.Index3);
+        var afterMatrix = EstimatedProbabilisticTravelingSalesmanProblem.Evaluate(tour, distances, realizations)[0];
 
-      double beforeMatrix = ePTSP.EvaluateWithParams(distances, ProbabilityMatrix, realizations, tour)[0];
-
-      for (int i = 0; i < 500; i++) {
-        var move = StochasticTranslocationSingleMoveGenerator.Apply(tour, random);
-
-        double moveMatrix = PTSPEstimatedInsertionEvaluator.EvaluateByDistanceMatrix(tour, move, distances, realizations);
-
-        string failureString = string.Format(@"Inversion move is calculated with quality {0}, but actual difference is {4}.
-The move would invert the tour {1} between values {2} and {3}.", moveMatrix.ToString(), tour.ToString(), tour[move.Index1].ToString(), tour[move.Index2].ToString(), "{0}");
-
-        TranslocationManipulator.Apply(tour, move.Index1, move.Index1, move.Index3);
-
-        double afterMatrix = ePTSP.EvaluateWithParams(distances, ProbabilityMatrix, realizations, tour)[0];
-
-        Assert.IsTrue(Math.Abs(moveMatrix).IsAlmost(Math.Abs(afterMatrix - beforeMatrix)), string.Format(failureString, (Math.Abs(afterMatrix - beforeMatrix)).ToString()));
+        Assert.IsTrue(Math.Abs(moveMatrix).IsAlmost(Math.Abs(afterMatrix - beforeMatrix)),
+          string.Format(@"Insertion move is calculated with quality {0}, but actual difference is {4}.
+The move would invert the tour {1} between values {2} and {3}.",
+          moveMatrix, tour, tour[move.Index1], tour[move.Index2], Math.Abs(afterMatrix - beforeMatrix)));
 
         beforeMatrix = afterMatrix;
@@ -122,15 +124,13 @@
 
     [TestMethod]
-    [TestCategory("Problems.TravelingSalesman")]
+    [TestCategory("Problems.ProbabilisticTravelingSalesman")]
     [TestProperty("Time", "short")]
     public void AnalyticalTest() {
-      for (int i = 0; i < 10; i++) {
-        tour = new Permutation(PermutationTypes.RelativeUndirected, ProblemSize, random);
-        EstimatedProbabilisticTravelingSalesmanProblem ePTSP = new EstimatedProbabilisticTravelingSalesmanProblem();
-        double estimated = ePTSP.EvaluateWithParams(distances, ProbabilityMatrix, realizations, tour)[0];
+      for (var i = 0; i < 10; i++) {
+        var perm = new Permutation(PermutationTypes.RelativeUndirected, ProblemSize, random);
+        var estimated = EstimatedProbabilisticTravelingSalesmanProblem.Evaluate(perm, distances, realizations)[0];
 
-        AnalyticalProbabilisticTravelingSalesmanProblem aPTSP = new AnalyticalProbabilisticTravelingSalesmanProblem();
-        double analytical = aPTSP.EvaluateWithParams(distances, ProbabilityMatrix, tour);
-        Console.WriteLine(Math.Abs(analytical-estimated));
+        var analytical = AnalyticalProbabilisticTravelingSalesmanProblem.Evaluate(perm, distances, probabilities);
+        Console.WriteLine(Math.Abs(analytical - estimated));
       }
     }
Index: /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/HeuristicLab.Problems.PTSP.Views-3.3.csproj
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/HeuristicLab.Problems.PTSP.Views-3.3.csproj	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/HeuristicLab.Problems.PTSP.Views-3.3.csproj	(revision 13412)
@@ -84,4 +84,9 @@
       <Private>False</Private>
     </Reference>
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
Index: /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/PathPTSPTourView.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/PathPTSPTourView.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/PathPTSPTourView.cs	(revision 13412)
@@ -22,5 +22,4 @@
 using System;
 using System.Drawing;
-using System.Windows.Forms;
 using HeuristicLab.Core.Views;
 using HeuristicLab.Data;
@@ -156,5 +155,4 @@
       }
     }
-
     private void Content_ProbabilitiesChanged(object sender, EventArgs e) {
       if (InvokeRequired)
Index: /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/Plugin.cs.frame
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/Plugin.cs.frame	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/Plugin.cs.frame	(revision 13412)
@@ -1,18 +1,41 @@
-﻿using HeuristicLab.PluginInfrastructure;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.PluginInfrastructure;
+
 namespace HeuristicLab.Problems.PTSP.Views {
-    [Plugin("HeuristicLab.Problems.PTSP.Views", "3.3.11.$WCREV$")]
-    [PluginFile("HeuristicLab.Problems.PTSP.Views-3.3.dll", PluginFileType.Assembly)]
-	[PluginDependency("HeuristicLab.Common", "3.3")]
-	[PluginDependency("HeuristicLab.Core", "3.3")]
-	[PluginDependency("HeuristicLab.Core.Views", "3.3")]
-	[PluginDependency("HeuristicLab.Data", "3.3")]
-	[PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
-	[PluginDependency("HeuristicLab.MainForm", "3.3")]
-	[PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
-	[PluginDependency("HeuristicLab.Optimization", "3.3")]
-	[PluginDependency("HeuristicLab.Optimization.Views", "3.3")]
-	[PluginDependency("HeuristicLab.Parameters", "3.3")]
-	[PluginDependency("HeuristicLab.Problems.PTSP", "3.3")]
-    public class Plugin : PluginBase {
-    }
+  [Plugin("HeuristicLab.Problems.PTSP.Views", "3.3.13.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.PTSP.Views-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.PTSP", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  public class HeuristicLabProblemsPTSPViewsPlugin : PluginBase {
+  }
 }
Index: /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/ProbabilisticTravelingSalesmanProblemView.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/ProbabilisticTravelingSalesmanProblemView.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/ProbabilisticTravelingSalesmanProblemView.cs	(revision 13412)
@@ -21,9 +21,8 @@
 
 using System;
-using System.Windows.Forms;
+using HeuristicLab.Data;
 using HeuristicLab.MainForm;
 using HeuristicLab.Optimization.Views;
-using HeuristicLab.Problems.PTSP;
-using HeuristicLab.Data;
+using HeuristicLab.Random;
 
 namespace HeuristicLab.Problems.PTSP.Views {
@@ -40,5 +39,5 @@
 
     /// <summary>
-    /// Initializes a new instance of <see cref="ProbabilisticTravelingSalesmanView"/>.
+    /// Initializes a new instance of <see cref="ProbabilisticTravelingSalesmanProblemView"/>.
     /// </summary>
     public ProbabilisticTravelingSalesmanProblemView() {
@@ -47,16 +46,14 @@
 
     protected override void DeregisterContentEvents() {
-      Content.CoordinatesParameter.ValueChanged -= new EventHandler(CoordinatesParameter_ValueChanged);
-      Content.ProbabilityMatrixParameter.ValueChanged -= new EventHandler(ProbabilityParameter_ValueChanged);
-      //Content.BestKnownQualityParameter.ValueChanged -= new EventHandler(BestKnownQualityParameter_ValueChanged);
-      Content.BestKnownSolutionParameter.ValueChanged -= new EventHandler(BestKnownSolutionParameter_ValueChanged);
+      Content.CoordinatesParameter.ValueChanged -= CoordinatesParameter_ValueChanged;
+      Content.ProbabilitiesParameter.ValueChanged -= ProbabilityParameter_ValueChanged;
+      Content.BestKnownSolutionParameter.ValueChanged -= BestKnownSolutionParameter_ValueChanged;
       base.DeregisterContentEvents();
     }
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
-      Content.CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged);
-      Content.ProbabilityMatrixParameter.ValueChanged += new EventHandler(ProbabilityParameter_ValueChanged);
-      //Content.BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged);
-      Content.BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged);
+      Content.CoordinatesParameter.ValueChanged += CoordinatesParameter_ValueChanged;
+      Content.ProbabilitiesParameter.ValueChanged += ProbabilityParameter_ValueChanged;
+      Content.BestKnownSolutionParameter.ValueChanged += BestKnownSolutionParameter_ValueChanged;
     }
     protected override void OnContentChanged() {
@@ -65,5 +62,5 @@
         pathPTSPTourView.Content = null;
       } else {
-        pathPTSPTourView.Content = new PathPTSPTour(Content.Coordinates, Content.ProbabilityMatrix, Content.BestKnownSolution, new DoubleValue(Content.BestKnownQuality));
+        pathPTSPTourView.Content = new PathPTSPTour(Content.Coordinates, Content.Probabilities, Content.BestKnownSolution, new DoubleValue(Content.BestKnownQuality));
       }
     }
@@ -77,13 +74,10 @@
       pathPTSPTourView.Content.Coordinates = Content.Coordinates;
     }
-
     private void ProbabilityParameter_ValueChanged(object sender, EventArgs e) {
-      pathPTSPTourView.Content.Probabilities = Content.ProbabilityMatrix;
-    }
-    private void BestKnownQualityParameter_ValueChanged(object sender, EventArgs e) {
-      pathPTSPTourView.Content.Quality = new DoubleValue(Content.BestKnownQuality);
+      pathPTSPTourView.Content.Probabilities = Content.Probabilities;
     }
     private void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) {
       pathPTSPTourView.Content.Permutation = Content.BestKnownSolution;
+      pathPTSPTourView.Content.Quality = new DoubleValue(Content.Evaluate(Content.BestKnownSolution, new MersenneTwister()));
     }
   }
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/AnalyticalPTSP.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/AnalyticalPTSP.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/AnalyticalPTSP.cs	(revision 13412)
@@ -1,28 +1,40 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using HeuristicLab.Optimization;
-using HeuristicLab.PluginInfrastructure;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.Instances;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Common;
-using HeuristicLab.Parameters;
-using HeuristicLab.Data;
 
 namespace HeuristicLab.Problems.PTSP {
-  [Item("Analytical Probabilistic Traveling Salesman Problem", "Represents an analytical Probabilistic Traveling Salesman Problem.")]
-  [Creatable("Problems")]
+  [Item("Analytical Probabilistic Traveling Salesman Problem (PTSP)", "Represents a probabilistic traveling salesman problem where the expected tour length is calculated exactly.")]
+  [Creatable(CreatableAttribute.Categories.CombinatorialProblems)]
   [StorableClass]
-  public sealed class AnalyticalProbabilisticTravelingSalesmanProblem : ProbabilisticTravelingSalesmanProblem, IStorableContent,
-  IProblemInstanceConsumer<PTSPData> {
+  public sealed class AnalyticalProbabilisticTravelingSalesmanProblem : ProbabilisticTravelingSalesmanProblem {
 
     [StorableConstructor]
     private AnalyticalProbabilisticTravelingSalesmanProblem(bool deserializing) : base(deserializing) { }
-    private AnalyticalProbabilisticTravelingSalesmanProblem(AnalyticalProbabilisticTravelingSalesmanProblem original, Cloner cloner)
-      : base(original, cloner) {
+    private AnalyticalProbabilisticTravelingSalesmanProblem(AnalyticalProbabilisticTravelingSalesmanProblem original, Cloner cloner) : base(original, cloner) { }
+    public AnalyticalProbabilisticTravelingSalesmanProblem() {
+      Operators.Add(new BestPTSPSolutionAnalyzer());
     }
 
@@ -31,117 +43,59 @@
     }
 
-    public override double Evaluate(Individual individual, IRandom random) {
-      Permutation p = individual.Permutation();
-      // Compute A and B matrices
-      DoubleMatrix A = new DoubleMatrix(p.Length, p.Length - 1);
-      DoubleMatrix B = new DoubleMatrix(p.Length, p.Length - 1);
-      //for (int i = 0; i < p.Length; i++) {
-      //  for (int k = 0; k < p.Length - 1; k++) {
-      //    double firstPartial = 0;
-      //    for (int r = k; k < p.Length - 1; r++) {
-      //       double sum0 = DistanceMatrix[p[i],p[i+r]]* ProbabilityMatrix[0, p[i]] * ProbabilityMatrix[0, p[i+r]];
-      //       for(int s = i+1; s < i+r; s++) {
-      //         sum0 = sum0 * (1 - ProbabilityMatrix[0, p[s]]);
-      //       }
-      //       firstPartial+=sum0;
-      //    }
-      //    double secondPartial = 0;
-      //    for (int r = k; k < p.Length - 1; r++) {
-      //       double sum1 = DistanceMatrix[p[i-r],p[i]]* ProbabilityMatrix[0, p[i-r]] * ProbabilityMatrix[0, p[i]];
-      //       for (int s = i + 1; s < p.Length-1; s++) {
-      //         sum1 = sum1 * (1 - ProbabilityMatrix[0, p[s]]);
-      //       }
-      //       for (int t = 1; t < i-1; t++) {
-      //         sum1 = sum1 * (1 - ProbabilityMatrix[0, p[t]]);
-      //       }
-      //       secondPartial+=sum1;
-      //    }
-      //    A[i, k] = firstPartial;
-      //    B[i, k] = secondPartial;
-      //  }
-      //}
-      
+    public override double Evaluate(Permutation tour, IRandom random) {
       // Analytical evaluation
       double firstSum = 0;
-      for (int i = 0; i < p.Length - 1; i++) {
-        for (int j = i + 1; j < p.Length - 1; j++) {
-          double sum1 = DistanceMatrix[p[i], p[j]] * ProbabilityMatrix[p[i]] * ProbabilityMatrix[p[j]];
+      for (int i = 0; i < tour.Length - 1; i++) {
+        for (int j = i + 1; j < tour.Length - 1; j++) {
+          double sum1 = DistanceMatrix[tour[i], tour[j]] * Probabilities[tour[i]] * Probabilities[tour[j]];
           for (int k = i + 1; k < j; k++) {
-            sum1 = sum1 * (1 - ProbabilityMatrix[p[k]]);
+            sum1 = sum1 * (1 - Probabilities[tour[k]]);
           }
-          A[i, j - 1] = sum1;
           firstSum += sum1;
         }
       }
       double secondSum = 0;
-      for (int j = 0; j < p.Length - 1; j++) {
+      for (int j = 0; j < tour.Length - 1; j++) {
         for (int i = 0; i < j; i++) {
-          double sum2 = DistanceMatrix[p[j], p[i]] * ProbabilityMatrix[p[i]] * ProbabilityMatrix[p[j]];
-          for (int k = j + 1; k < p.Length - 1; k++) {
-            sum2 = sum2 * (1 - ProbabilityMatrix[p[k]]);
+          double sum2 = DistanceMatrix[tour[j], tour[i]] * Probabilities[tour[i]] * Probabilities[tour[j]];
+          for (int k = j + 1; k < tour.Length - 1; k++) {
+            sum2 = sum2 * (1 - Probabilities[tour[k]]);
           }
           for (int k = 1; k < i; k++) {
-            sum2 = sum2 * (1 - ProbabilityMatrix[p[k]]);
+            sum2 = sum2 * (1 - Probabilities[tour[k]]);
           }
-          B[i, j] = sum2;
           secondSum += sum2;
         }
-      }
-      foreach (var op in Operators.OfType<PTSPAnalyticalInversionMovePathEvaluator>()) {
-        op.AParameter.Value = A;
-        op.BParameter.Value = B;
       }
       return firstSum + secondSum;
     }
 
-    public double EvaluateWithParams(DistanceMatrix distances, DoubleArray probabilities, Permutation individual) {
-      Permutation p = individual;
-      // Compute A and B matrices
-      DoubleMatrix A = new DoubleMatrix(p.Length, p.Length - 1);
-      DoubleMatrix B = new DoubleMatrix(p.Length, p.Length - 1);
+    public static double Evaluate(Permutation tour, DistanceMatrix distanceMatrix, DoubleArray probabilities) {
       // Analytical evaluation
-      double firstSum = 0;
-      for (int i = 0; i < p.Length; i++) {
-        for (int j = i + 1; j < p.Length; j++) {
-          double sum1 = distances[p[i], p[j]] * probabilities[p[i]] * probabilities[p[j]];
-          for (int k = i + 1; k < j; k++) {
-            sum1 = sum1 * (1 - probabilities[p[k]]);
+      var firstSum = 0.0;
+      for (var i = 0; i < tour.Length; i++) {
+        for (var j = i + 1; j < tour.Length; j++) {
+          var sum1 = distanceMatrix[tour[i], tour[j]] * probabilities[tour[i]] * probabilities[tour[j]];
+          for (var k = i + 1; k < j; k++) {
+            sum1 = sum1 * (1 - probabilities[tour[k]]);
           }
-          A[i, j - 1] = sum1;
           firstSum += sum1;
         }
       }
-      double secondSum = 0;
-      for (int j = 0; j < p.Length; j++) {
-        for (int i = 0; i < j; i++) {
-          double sum2 = distances[p[j], p[i]] * probabilities[p[i]] * probabilities[p[j]];
-          for (int k = j + 1; k < p.Length; k++) {
-            sum2 = sum2 * (1 - probabilities[p[k]]);
+      var secondSum = 0.0;
+      for (var j = 0; j < tour.Length; j++) {
+        for (var i = 0; i < j; i++) {
+          var sum2 = distanceMatrix[tour[j], tour[i]] * probabilities[tour[i]] * probabilities[tour[j]];
+          for (var k = j + 1; k < tour.Length; k++) {
+            sum2 = sum2 * (1 - probabilities[tour[k]]);
           }
-          for (int k = 0; k < i; k++) {
-            sum2 = sum2 * (1 - probabilities[p[k]]);
+          for (var k = 0; k < i; k++) {
+            sum2 = sum2 * (1 - probabilities[tour[k]]);
           }
-          B[j,i] = sum2;
           secondSum += sum2;
         }
       }
-      foreach (var op in Operators.OfType<PTSPAnalyticalInversionMovePathEvaluator>()) {
-        op.AParameter.Value = A;
-        op.BParameter.Value = B;
-      }
       return firstSum + secondSum;
     }
-
-    public AnalyticalProbabilisticTravelingSalesmanProblem() {
-      Operators.Add(new PTSPAnalyticalInversionMovePathEvaluator());
-    }
-
-    public override void Load(PTSPData data) {
-      base.Load(data);
-      foreach (var op in Operators.OfType<PTSPAnalyticalInversionMovePathEvaluator>()) {
-        op.ProbabilitiesParameter.Value = ProbabilityMatrix;
-      }
-    }
-
   }
 }
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Analyzers/BestPTSPSolutionAnalyzer.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Analyzers/BestPTSPSolutionAnalyzer.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Analyzers/BestPTSPSolutionAnalyzer.cs	(revision 13412)
@@ -32,5 +32,5 @@
 namespace HeuristicLab.Problems.PTSP {
   /// <summary>
-  /// An operator for analyzing the best solution of Traveling Salesman Problems given in path representation using city coordinates.
+  /// An operator for analyzing the best solution of probabilistic traveling salesman problems given in path representation.
   /// </summary>
   [Item("BestPTSPSolutionAnalyzer", "An operator for analyzing the best solution of Probabilistic Traveling Salesman Problems given in path representation using city coordinates.")]
@@ -41,30 +41,30 @@
     }
 
-    public LookupParameter<BoolValue> MaximizationParameter {
-      get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; }
+    public ILookupParameter<BoolValue> MaximizationParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; }
     }
-    public LookupParameter<DoubleMatrix> CoordinatesParameter {
-      get { return (LookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
+    public ILookupParameter<DoubleMatrix> CoordinatesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
     }
-    public ScopeTreeLookupParameter<Permutation> PermutationParameter {
-      get { return (ScopeTreeLookupParameter<Permutation>)Parameters["Permutation"]; }
+    public IScopeTreeLookupParameter<Permutation> PermutationParameter {
+      get { return (IScopeTreeLookupParameter<Permutation>)Parameters["Permutation"]; }
     }
-    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
-      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
     }
-    public LookupParameter<DoubleArray> ProbabilityMatrixParameter {
-      get { return (LookupParameter<DoubleArray>)Parameters["ProbabilityMatrix"]; }
+    public ILookupParameter<DoubleArray> ProbabilitiesParameter {
+      get { return (ILookupParameter<DoubleArray>)Parameters["Probabilities"]; }
     }
-    public LookupParameter<PathPTSPTour> BestSolutionParameter {
-      get { return (LookupParameter<PathPTSPTour>)Parameters["BestSolution"]; }
+    public ILookupParameter<PathPTSPTour> BestSolutionParameter {
+      get { return (ILookupParameter<PathPTSPTour>)Parameters["BestSolution"]; }
     }
-    public ValueLookupParameter<ResultCollection> ResultsParameter {
-      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
+    public IValueLookupParameter<ResultCollection> ResultsParameter {
+      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
     }
-    public LookupParameter<DoubleValue> BestKnownQualityParameter {
-      get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    public ILookupParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     }
-    public LookupParameter<Permutation> BestKnownSolutionParameter {
-      get { return (LookupParameter<Permutation>)Parameters["BestKnownSolution"]; }
+    public ILookupParameter<Permutation> BestKnownSolutionParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["BestKnownSolution"]; }
     }
 
@@ -81,34 +81,22 @@
       Parameters.Add(new ScopeTreeLookupParameter<Permutation>("Permutation", "The PTSP solutions given in path representation from which the best solution should be analyzed."));
       Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the PTSP solutions which should be analyzed."));
-      Parameters.Add(new LookupParameter<DoubleArray>("ProbabilityMatrix", "The matrix which contains the probabilities of each of the cities."));
+      Parameters.Add(new LookupParameter<DoubleArray>("Probabilities", "This list describes for each city the probability of appearing in a realized instance."));
       Parameters.Add(new LookupParameter<PathPTSPTour>("BestSolution", "The best PTSP solution."));
       Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best PTSP solution should be stored."));
       Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this PTSP instance."));
       Parameters.Add(new LookupParameter<Permutation>("BestKnownSolution", "The best known solution of this PTSP instance."));
-
-      MaximizationParameter.Hidden = true;
-      CoordinatesParameter.Hidden = true;
-      PermutationParameter.Hidden = true;
-      QualityParameter.Hidden = true;
-      ProbabilityMatrixParameter.Hidden = true;
-      BestSolutionParameter.Hidden = true;
-      ResultsParameter.Hidden = true;
-      BestKnownQualityParameter.Hidden = true;
-      BestKnownSolutionParameter.Hidden = true;
     }
 
     public override IOperation Apply() {
-      DoubleMatrix coordinates = CoordinatesParameter.ActualValue;
-      ItemArray<Permutation> permutations = PermutationParameter.ActualValue;
-      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
-      DoubleArray probabilities = ProbabilityMatrixParameter.ActualValue;
-      ResultCollection results = ResultsParameter.ActualValue;
-      bool max = MaximizationParameter.ActualValue.Value;
-      DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue;
+      var coordinates = CoordinatesParameter.ActualValue;
+      var permutations = PermutationParameter.ActualValue;
+      var qualities = QualityParameter.ActualValue;
+      var probabilities = ProbabilitiesParameter.ActualValue;
+      var results = ResultsParameter.ActualValue;
+      var max = MaximizationParameter.ActualValue.Value;
+      var bestKnownQuality = BestKnownQualityParameter.ActualValue;
 
-      int i = -1;
-      if (!max)
-        i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
-      else i = qualities.Select((x, index) => new { index, x.Value }).OrderByDescending(x => x.Value).First().index;
+      var i = !max ? qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index
+                   : qualities.Select((x, index) => new { index, x.Value }).OrderByDescending(x => x.Value).First().index;
 
       if (bestKnownQuality == null ||
@@ -119,7 +107,7 @@
       }
 
-      PathPTSPTour tour = BestSolutionParameter.ActualValue;
+      var tour = BestSolutionParameter.ActualValue;
       if (tour == null) {
-        tour = new PathPTSPTour(coordinates,probabilities, (Permutation)permutations[i].Clone(), new DoubleValue(qualities[i].Value));
+        tour = new PathPTSPTour(coordinates, probabilities, (Permutation)permutations[i].Clone(), new DoubleValue(qualities[i].Value));
         BestSolutionParameter.ActualValue = tour;
         results.Add(new Result("Best PTSP Solution", tour));
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/AttDistance.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/AttDistance.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/AttDistance.cs	(revision 13412)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.Instances;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Att Distance", "Calculates the att distance.")]
+  [StorableClass]
+  public sealed class AttDistance : DistanceCalculator {
+
+    [StorableConstructor]
+    private AttDistance(bool deserializing) : base(deserializing) { }
+    private AttDistance(AttDistance original, Cloner cloner) : base(original, cloner) { }
+    public AttDistance() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AttDistance(this, cloner);
+    }
+
+    public override double Calculate(int from, int to, DoubleMatrix coordinates) {
+      return DistanceHelper.GetDistance(DistanceMeasure.Att, coordinates[from, 0], coordinates[from, 1], coordinates[to, 0], coordinates[to, 1]);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/DistanceCalculator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/DistanceCalculator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/DistanceCalculator.cs	(revision 13412)
@@ -0,0 +1,38 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Distance calculator", "Calculates the distance between two cities given as index of a coordinates matrix.")]
+  [StorableClass]
+  public abstract class DistanceCalculator : Item {
+    [StorableConstructor]
+    protected DistanceCalculator(bool deserializing) : base(deserializing) { }
+    protected DistanceCalculator(DistanceCalculator original, Cloner cloner) : base(original, cloner) { }
+    protected DistanceCalculator() { }
+
+    public abstract double Calculate(int from, int to, DoubleMatrix coordinates);
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/EuclideanDistance.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/EuclideanDistance.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/EuclideanDistance.cs	(revision 13412)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.Instances;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Euclidean Distance", "Calculates the euclidean distance.")]
+  [StorableClass]
+  public sealed class EuclideanDistance : DistanceCalculator {
+
+    [StorableConstructor]
+    private EuclideanDistance(bool deserializing) : base(deserializing) { }
+    private EuclideanDistance(EuclideanDistance original, Cloner cloner) : base(original, cloner) { }
+    public EuclideanDistance() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new EuclideanDistance(this, cloner);
+    }
+
+    public override double Calculate(int from, int to, DoubleMatrix coordinates) {
+      return DistanceHelper.GetDistance(DistanceMeasure.Euclidean, coordinates[from, 0], coordinates[from, 1], coordinates[to, 0], coordinates[to, 1]);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/GeoDistance.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/GeoDistance.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/GeoDistance.cs	(revision 13412)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.Instances;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Geo Distance", "Calculates the geo distance.")]
+  [StorableClass]
+  public sealed class GeoDistance : DistanceCalculator {
+
+    [StorableConstructor]
+    private GeoDistance(bool deserializing) : base(deserializing) { }
+    private GeoDistance(GeoDistance original, Cloner cloner) : base(original, cloner) { }
+    public GeoDistance() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GeoDistance(this, cloner);
+    }
+
+    public override double Calculate(int from, int to, DoubleMatrix coordinates) {
+      return DistanceHelper.GetDistance(DistanceMeasure.Geo, coordinates[from, 0], coordinates[from, 1], coordinates[to, 0], coordinates[to, 1]);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/ManhattanDistance.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/ManhattanDistance.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/ManhattanDistance.cs	(revision 13412)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.Instances;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Manhattan Distance", "Calculates the Manhattan distance.")]
+  [StorableClass]
+  public sealed class ManhattanDistance : DistanceCalculator {
+
+    [StorableConstructor]
+    private ManhattanDistance(bool deserializing) : base(deserializing) { }
+    private ManhattanDistance(ManhattanDistance original, Cloner cloner) : base(original, cloner) { }
+    public ManhattanDistance() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ManhattanDistance(this, cloner);
+    }
+
+    public override double Calculate(int from, int to, DoubleMatrix coordinates) {
+      return DistanceHelper.GetDistance(DistanceMeasure.Manhattan, coordinates[from, 0], coordinates[from, 1], coordinates[to, 0], coordinates[to, 1]);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/MaximumDistance.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/MaximumDistance.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/MaximumDistance.cs	(revision 13412)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.Instances;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Maximum Distance", "Calculates the maximum distance.")]
+  [StorableClass]
+  public sealed class MaximumDistance : DistanceCalculator {
+
+    [StorableConstructor]
+    private MaximumDistance(bool deserializing) : base(deserializing) { }
+    private MaximumDistance(MaximumDistance original, Cloner cloner) : base(original, cloner) { }
+    public MaximumDistance() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MaximumDistance(this, cloner);
+    }
+
+    public override double Calculate(int from, int to, DoubleMatrix coordinates) {
+      return DistanceHelper.GetDistance(DistanceMeasure.Maximum, coordinates[from, 0], coordinates[from, 1], coordinates[to, 0], coordinates[to, 1]);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/RoundedEuclideanDistance.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/RoundedEuclideanDistance.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/RoundedEuclideanDistance.cs	(revision 13412)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.Instances;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Rounded Euclidean Distance", "Calculates the euclidean distance and rounds it to the nearest integer.")]
+  [StorableClass]
+  public sealed class RoundedEuclideanDistance : DistanceCalculator {
+
+    [StorableConstructor]
+    private RoundedEuclideanDistance(bool deserializing) : base(deserializing) { }
+    private RoundedEuclideanDistance(RoundedEuclideanDistance original, Cloner cloner) : base(original, cloner) { }
+    public RoundedEuclideanDistance() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new RoundedEuclideanDistance(this, cloner);
+    }
+
+    public override double Calculate(int from, int to, DoubleMatrix coordinates) {
+      return DistanceHelper.GetDistance(DistanceMeasure.RoundedEuclidean, coordinates[from, 0], coordinates[from, 1], coordinates[to, 0], coordinates[to, 1]);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/UpperEuclideanDistance.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/UpperEuclideanDistance.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceCalculators/UpperEuclideanDistance.cs	(revision 13412)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.Instances;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Upper Euclidean Distance", "Calculates the ceiling of the euclidean distance.")]
+  [StorableClass]
+  public sealed class UpperEuclideanDistance : DistanceCalculator {
+
+    [StorableConstructor]
+    private UpperEuclideanDistance(bool deserializing) : base(deserializing) { }
+    private UpperEuclideanDistance(UpperEuclideanDistance original, Cloner cloner) : base(original, cloner) { }
+    public UpperEuclideanDistance() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new UpperEuclideanDistance(this, cloner);
+    }
+
+    public override double Calculate(int from, int to, DoubleMatrix coordinates) {
+      return DistanceHelper.GetDistance(DistanceMeasure.UpperEuclidean, coordinates[from, 0], coordinates[from, 1], coordinates[to, 0], coordinates[to, 1]);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceMatrix.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceMatrix.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/DistanceMatrix.cs	(revision 13412)
@@ -1,3 +1,24 @@
-﻿using System;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
 using System.Collections.Generic;
 using HeuristicLab.Common;
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/EstimatedPTSP.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/EstimatedPTSP.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/EstimatedPTSP.cs	(revision 13412)
@@ -1,44 +1,58 @@
-﻿using System.Text;
-using System.Threading.Tasks;
-using HeuristicLab.Optimization;
-using HeuristicLab.PluginInfrastructure;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.Instances;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Common;
-using HeuristicLab.Parameters;
-using HeuristicLab.Data;
 using HeuristicLab.Random;
-using System;
-using System.Linq;
 
 namespace HeuristicLab.Problems.PTSP {
-  [Item("Estimated Probabilistic Traveling Salesman Problem", "Represents an estimated Probabilistic Traveling Salesman Problem.")]
-  [Creatable("Problems")]
+  [Item("Estimated Probabilistic Traveling Salesman Problem (PTSP)", "Represents a probabilistic traveling salesman problem where the expected tour length is estimated by averaging over the length of tours on a number of, so called, realizations.")]
+  [Creatable(CreatableAttribute.Categories.CombinatorialProblems)]
   [StorableClass]
-  public sealed class EstimatedProbabilisticTravelingSalesmanProblem : ProbabilisticTravelingSalesmanProblem, IStorableContent,
-  IProblemInstanceConsumer<PTSPData> {
-
+  public sealed class EstimatedProbabilisticTravelingSalesmanProblem : ProbabilisticTravelingSalesmanProblem {
 
     #region Parameter Properties
-    public ValueParameter<ItemList<ItemList<IntValue>>> RealizationsParameter {
-      get { return (ValueParameter<ItemList<ItemList<IntValue>>>)Parameters["Realizations"]; }
-    }
-    public ValueParameter<IntValue> RealizationsSizeParameter {
-      get { return (ValueParameter<IntValue>)Parameters["RealizationsSize"]; }
-    }
-
+    public IValueParameter<ItemList<BoolArray>> RealizationsParameter {
+      get { return (IValueParameter<ItemList<BoolArray>>)Parameters["Realizations"]; }
+    }
+    public IFixedValueParameter<IntValue> RealizationsSizeParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["RealizationsSize"]; }
+    }
     #endregion
 
     #region Properties
-    public ItemList<ItemList<IntValue>> Realizations {
+    public ItemList<BoolArray> Realizations {
       get { return RealizationsParameter.Value; }
       set { RealizationsParameter.Value = value; }
     }
 
-    public IntValue RealizationsSize {
-      get { return RealizationsSizeParameter.Value; }
-      set { RealizationsSizeParameter.Value = value; }
+    public int RealizationsSize {
+      get { return RealizationsSizeParameter.Value.Value; }
+      set { RealizationsSizeParameter.Value.Value = value; }
     }
     #endregion
@@ -51,29 +65,25 @@
     }
     public EstimatedProbabilisticTravelingSalesmanProblem() {
-      Parameters.Add(new ValueParameter<IntValue>("RealizationsSize", "Size of the sample for the estimation-based evaluation"));
-      Parameters.Add(new ValueParameter<ItemList<ItemList<IntValue>>>("Realizations", "The concrete..."));
-
-      Operators.RemoveAll(x => x is ISingleObjectiveMoveEvaluator);
-      Operators.RemoveAll(x => x is IMoveGenerator);
-      Operators.RemoveAll(x => x is IMoveMaker);
+      Parameters.Add(new FixedValueParameter<IntValue>("RealizationsSize", "Size of the sample for the estimation-based evaluation", new IntValue(100)));
+      Parameters.Add(new ValueParameter<ItemList<BoolArray>>("Realizations", "The list of samples drawn from all possible stochastic instances.", new ItemList<BoolArray>()));
 
       Operators.Add(new BestPTSPSolutionAnalyzer());
 
-      Operators.Add(new PTSPEstimatedInversionEvaluator());
-      Operators.Add(new PTSPEstimatedInsertionEvaluator());
+      Operators.Add(new PTSPEstimatedInversionMoveEvaluator());
+      Operators.Add(new PTSPEstimatedInsertionMoveEvaluator());
       Operators.Add(new PTSPExhaustiveInversionLocalImprovement());
       Operators.Add(new PTSPExhaustiveInsertionLocalImprovement());
 
-      Operators.Add(new Exhaustive25MoveGenerator());
-      Operators.Add(new Stochastic25MultiMoveGenerator());
-      Operators.Add(new Stochastic25SingleMoveGenerator());
+      Operators.Add(new ExhaustiveTwoPointFiveMoveGenerator());
+      Operators.Add(new StochasticTwoPointFiveMultiMoveGenerator());
+      Operators.Add(new StochasticTwoPointFiveSingleMoveGenerator());
       Operators.Add(new TwoPointFiveMoveMaker());
-      Operators.Add(new PTSP25MoveEvaluator());
+      Operators.Add(new PTSPTwoPointFiveMoveEvaluator());
 
       Encoding.ConfigureOperators(Operators.OfType<IOperator>());
-      foreach (var twopointfiveMoveOperator in Operators.OfType<I25MoveOperator>()) {
+      foreach (var twopointfiveMoveOperator in Operators.OfType<ITwoPointFiveMoveOperator>()) {
         twopointfiveMoveOperator.TwoPointFiveMoveParameter.ActualName = "Permutation.TwoPointFiveMove";
       }
-      RealizationsSize = new IntValue(100);
+
       RegisterEventHandlers();
     }
@@ -83,93 +93,98 @@
     }
 
-    public override double Evaluate(Individual individual, IRandom random) {
-      Permutation p = individual.Permutation();
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEventHandlers();
+    }
+
+    private void RegisterEventHandlers() {
+      RealizationsSizeParameter.Value.ValueChanged += RealizationsSizeParameter_ValueChanged;
+    }
+
+    private void RealizationsSizeParameter_ValueChanged(object sender, EventArgs e) {
+      UpdateRealizations();
+    }
+
+    public override double Evaluate(Permutation tour, IRandom random) {
       // Estimation-based evaluation
-      MersenneTwister r = new MersenneTwister();
-      double estimatedSum = 0;
-      for (int i = 0; i < Realizations.Count; i++) {
+      var estimatedSum = 0.0;
+      for (var i = 0; i < Realizations.Count; i++) {
         int singleRealization = -1, firstNode = -1;
-        for (int j = 0; j < Realizations[i].Count; j++) {
-          if (Realizations[i][p[j]].Value == 1) {
+        for (var j = 0; j < Realizations[i].Length; j++) {
+          if (Realizations[i][tour[j]]) {
             if (singleRealization != -1) {
-              estimatedSum += DistanceMatrix[singleRealization, p[j]];
+              estimatedSum += GetDistance(singleRealization, tour[j]);
             } else {
-              firstNode = p[j];
+              firstNode = tour[j];
             }
-            singleRealization = p[j];
+            singleRealization = tour[j];
           }
         }
         if (singleRealization != -1) {
-          estimatedSum += DistanceMatrix[singleRealization, firstNode];
-        }
-      }
-      return estimatedSum / RealizationsSize.Value;
-    }
-
-    public double[] EvaluateWithParams(DistanceMatrix distances, DoubleArray probabilities, ItemList<ItemList<IntValue>> realizations, Permutation individual ) {
+          estimatedSum += GetDistance(singleRealization, firstNode);
+        }
+      }
+      return estimatedSum / RealizationsSize;
+    }
+
+    /// <summary>
+    /// An evaluate method that can be used if mean as well as variance should be calculated
+    /// </summary>
+    /// <param name="tour">The tour between all cities.</param>
+    /// <param name="distanceMatrix">The distances between the cities.</param>
+    /// <param name="realizations">A sample of realizations of the stochastic instance</param>
+    /// <returns>A vector with length two containing mean and variance.</returns>
+    public static double[] Evaluate(Permutation tour, DistanceMatrix distanceMatrix, ItemList<BoolArray> realizations) {
       // Estimation-based evaluation
-      MersenneTwister r = new MersenneTwister();
-      double estimatedSum = 0;
-      double[] partialSums = new double[realizations.Count];
-      for (int i = 0; i < realizations.Count; i++) {
+      var estimatedSum = 0.0;
+      var partialSums = new double[realizations.Count];
+      for (var i = 0; i < realizations.Count; i++) {
         partialSums[i] = 0;
         int singleRealization = -1, firstNode = -1;
-        for (int j = 0; j < realizations[i].Count; j++) {
-          if (realizations[i][individual[j]].Value == 1) {
+        for (var j = 0; j < realizations[i].Length; j++) {
+          if (realizations[i][tour[j]]) {
             if (singleRealization != -1) {
-              partialSums[i] += distances[singleRealization, individual[j]];
+              partialSums[i] += distanceMatrix[singleRealization, tour[j]];
             } else {
-              firstNode = individual[j];
+              firstNode = tour[j];
             }
-            singleRealization = individual[j];
+            singleRealization = tour[j];
           }
         }
         if (singleRealization != -1) {
-          partialSums[i] += distances[singleRealization, firstNode];
+          partialSums[i] += distanceMatrix[singleRealization, firstNode];
         }
         estimatedSum += partialSums[i];
       }
-      double mean = estimatedSum / realizations.Count;
-      double variance = 0;
-      for (int i = 0; i < realizations.Count; i++) {
+      var mean = estimatedSum / realizations.Count;
+      var variance = 0.0;
+      for (var i = 0; i < realizations.Count; i++) {
         variance += Math.Pow((partialSums[i] - mean), 2);
       }
       variance = variance / realizations.Count;
-      return new double[] {mean,variance};
-    }
-
-    
-
-    private void RegisterEventHandlers() {
-      //RealizationsSizeParameter.ValueChanged += new EventHandler(RealizationsSizeParameter_ValueChanged);
-      RealizationsSize.ValueChanged += new EventHandler(RealizationsSizeParameter_ValueChanged);
-      //RealizationsSizeParameter.Value.ValueChanged += new EventHandler(RealizationsSizeParameter_ValueChanged);
-    }
-
-    private void RealizationsSizeParameter_ValueChanged(object sender, EventArgs e) {
-      UpdateRealizations();
+      return new[] { mean, variance };
+    }
+
+    public double GetDistance(int from, int to) {
+      if (UseDistanceMatrix) return DistanceMatrix[from, to];
+      return DistanceCalculator.Calculate(from, to, Coordinates);
     }
 
     private void UpdateRealizations() {
-      MersenneTwister r = new MersenneTwister();
-      int countOnes = 0;
-      Realizations = new ItemList<ItemList<IntValue>>(RealizationsSize.Value);
-      for (int i = 0; i < RealizationsSize.Value; i++) {
-        ItemList<IntValue> newRealization = new ItemList<IntValue>();
-        while (countOnes < 4) { //only generate realizations with at least 4 cities visited
+      var realizations = new ItemList<BoolArray>(RealizationsSize);
+      var rand = new MersenneTwister();
+      for (var i = 0; i < RealizationsSize; i++) {
+        var newRealization = new BoolArray(Probabilities.Length);
+        var countOnes = 0;
+        while (countOnes < 4) { // only generate realizations with at least 4 cities visited
           countOnes = 0;
-          newRealization.Clear();
-          for (int j = 0; j < DistanceMatrix.Rows; j++) {
-            if (ProbabilityMatrix[j] > r.NextDouble()) {
-              newRealization.Add(new IntValue(1));
-              countOnes++;
-            } else {
-              newRealization.Add(new IntValue(0));
-            }
+          for (var j = 0; j < Probabilities.Length; j++) {
+            newRealization[j] = Probabilities[j] < rand.NextDouble();
+            if (newRealization[j]) countOnes++;
           }
         }
-        countOnes = 0;
         Realizations.Add(newRealization);
       }
+      Realizations = realizations;
     }
 
@@ -178,14 +193,7 @@
       UpdateRealizations();
 
-      foreach (var op in Operators.OfType<PTSPMoveEvaluator>()) {
-        op.RealizationsParameter.Value = Realizations;
-      }
-      foreach (var op in Operators.OfType<PTSPExhaustiveInversionLocalImprovement>()) {
-        op.RealizationsParameter.Value = Realizations;
-      }
-      foreach (var op in Operators.OfType<PTSP25MoveEvaluator>()) {
-        op.RealizationsParameter.Value = Realizations;
-      }
-
+      foreach (var op in Operators.OfType<IEstimatedPTSPOperator>()) {
+        op.RealizationsParameter.ActualName = RealizationsParameter.Name;
+      }
     }
   }
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj	(revision 13412)
@@ -93,17 +93,8 @@
       <Private>False</Private>
     </Reference>
-    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="HeuristicLab.Problems.Instances.TSPLIB-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances.TSPLIB-3.3.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
     <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="System" />
@@ -118,26 +109,32 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="PTSPData.cs" />
-    <Compile Include="PTSPLIBInstanceProvider.cs" />
     <None Include="Properties\AssemblyInfo.cs.frame" />
     <None Include="Plugin.cs.frame" />
     <Compile Include="AnalyticalPTSP.cs" />
     <Compile Include="Analyzers\BestPTSPSolutionAnalyzer.cs" />
+    <Compile Include="DistanceCalculators\MaximumDistance.cs" />
+    <Compile Include="DistanceCalculators\ManhattanDistance.cs" />
+    <Compile Include="DistanceCalculators\GeoDistance.cs" />
+    <Compile Include="DistanceCalculators\DistanceCalculator.cs" />
+    <Compile Include="DistanceCalculators\AttDistance.cs" />
+    <Compile Include="DistanceCalculators\UpperEuclideanDistance.cs" />
+    <Compile Include="DistanceCalculators\RoundedEuclideanDistance.cs" />
+    <Compile Include="DistanceCalculators\EuclideanDistance.cs" />
     <Compile Include="DistanceMatrix.cs" />
     <Compile Include="EstimatedPTSP.cs" />
     <Compile Include="Improvers\PTSPExhaustiveInsertionLocalImprovement.cs" />
     <Compile Include="Improvers\PTSPExhaustiveInversionLocalImprovement.cs" />
-    <Compile Include="Interfaces\I25MoveOperator.cs" />
-    <Compile Include="Interfaces\IPTSPMoveEvaluator.cs" />
-    <Compile Include="MoveEvaluators\OneShift\PTSPEstimatedInsertionEvaluator.cs" />
-    <Compile Include="MoveEvaluators\PTSPMoveEvaluator.cs" />
-    <Compile Include="MoveEvaluators\TwoOpt\PTSPAnalyticalInversionMovePathEvaluator.cs" />
-    <Compile Include="MoveEvaluators\TwoOpt\PTSPEstimatedInversionEvaluator.cs" />
-    <Compile Include="MoveEvaluators\TwoPointFiveOpt\PTSP25MoveEvaluator.cs" />
-    <Compile Include="MoveGenerators\Exhaustive25MoveGenerator.cs" />
-    <Compile Include="MoveGenerators\Stochastic25MultiMoveGenerator.cs" />
-    <Compile Include="MoveGenerators\Stochastic25SingleMoveGenerator.cs" />
-    <Compile Include="MoveGenerators\TwoPointFiveMoveGenerator.cs" />
-    <Compile Include="MoveMakers\TwoPointFiveMoveMaker.cs" />
+    <Compile Include="Interfaces\IEstimatedPTSPOperator.cs" />
+    <Compile Include="Interfaces\ITwoPointFiveMoveOperator.cs" />
+    <Compile Include="Interfaces\IEstimatedPTSPMoveEvaluator.cs" />
+    <Compile Include="Moves\OneShift\PTSPEstimatedInsertionMoveEvaluator.cs" />
+    <Compile Include="Moves\EstimatedPTSPMoveEvaluator.cs" />
+    <Compile Include="Moves\TwoOpt\PTSPEstimatedInversionMoveEvaluator.cs" />
+    <Compile Include="Moves\TwoPointFiveOpt\PTSPTwoPointFiveMoveEvaluator.cs" />
+    <Compile Include="Moves\TwoPointFiveOpt\ExhaustiveTwoPointFiveMoveGenerator.cs" />
+    <Compile Include="Moves\TwoPointFiveOpt\StochasticTwoPointFiveMultiMoveGenerator.cs" />
+    <Compile Include="Moves\TwoPointFiveOpt\StochasticTwoPointFiveSingleMoveGenerator.cs" />
+    <Compile Include="Moves\TwoPointFiveOpt\TwoPointFiveMoveGenerator.cs" />
+    <Compile Include="Moves\TwoPointFiveOpt\TwoPointFiveMoveMaker.cs" />
     <Compile Include="Moves\TwoPointFiveOpt\TwoPointFiveMove.cs" />
     <Compile Include="PathPTSPTour.cs" />
@@ -149,5 +146,11 @@
     <None Include="HeuristicLab.snk" />
   </ItemGroup>
-  <ItemGroup />
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
+      <Project>{3540e29e-4793-49e7-8ee2-fea7f61c3994}</Project>
+      <Name>HeuristicLab.Problems.Instances-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj.DotSettings
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj.DotSettings	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj.DotSettings	(revision 13412)
@@ -0,0 +1,15 @@
+﻿<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=analyzers/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=distancecalculators/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=improvers/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=interfaces/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=moveevaluators/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=moveevaluators_005Coneshift/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=moveevaluators_005Ctwoopt/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=moveevaluators_005Ctwopointfiveopt/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=movegenerators/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=movemakers/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=moves/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=moves_005Coneshift/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=moves_005Ctwoopt/@EntryIndexedValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=moves_005Ctwopointfiveopt/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Improvers/PTSPExhaustiveInsertionLocalImprovement.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Improvers/PTSPExhaustiveInsertionLocalImprovement.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Improvers/PTSPExhaustiveInsertionLocalImprovement.cs	(revision 13412)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Threading;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -29,5 +30,4 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using System.Threading;
 
 namespace HeuristicLab.Problems.PTSP {
@@ -36,10 +36,10 @@
   /// </summary>
   /// <remarks>
-  /// The operator tries to improve the probabilistic traveling salesman solution by swapping two randomly chosen edges for a certain number of times.
+  /// The operator tries to improve the probabilistic traveling salesman solution by inserting a city in the tour between two other cities for a certain number of times.
   /// </remarks>
   [Item("PTSPExhaustiveInsertionLocalImprovement", "An operator that improves probabilistic traveling salesman solutions. The operator tries to improve the probabilistic traveling salesman solution by swapping two randomly chosen edges for a certain number of times.")]
   [StorableClass]
-  public sealed class PTSPExhaustiveInsertionLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator {
-  
+  public sealed class PTSPExhaustiveInsertionLocalImprovement : SingleSuccessorOperator, IEstimatedPTSPOperator, ILocalImprovementOperator {
+
     public ILookupParameter<IntValue> LocalIterationsParameter {
       get { return (ILookupParameter<IntValue>)Parameters["LocalIterations"]; }
@@ -74,13 +74,11 @@
     }
 
-    public IValueParameter<ItemList<ItemList<IntValue>>> RealizationsParameter {
-      get { return (IValueParameter<ItemList<ItemList<IntValue>>>)Parameters["Realizations"]; }
+    public ILookupParameter<ItemList<BoolArray>> RealizationsParameter {
+      get { return (ILookupParameter<ItemList<BoolArray>>)Parameters["Realizations"]; }
     }
 
     [StorableConstructor]
-    protected PTSPExhaustiveInsertionLocalImprovement(bool deserializing) : base(deserializing) { }
-    protected PTSPExhaustiveInsertionLocalImprovement(PTSPExhaustiveInsertionLocalImprovement original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    private PTSPExhaustiveInsertionLocalImprovement(bool deserializing) : base(deserializing) { }
+    private PTSPExhaustiveInsertionLocalImprovement(PTSPExhaustiveInsertionLocalImprovement original, Cloner cloner) : base(original, cloner) { }
     public PTSPExhaustiveInsertionLocalImprovement()
       : base() {
@@ -93,5 +91,5 @@
       Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem should be maximized or minimized."));
       Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
-      Parameters.Add(new ValueParameter<ItemList<ItemList<IntValue>>>("Realizations", "The concrete..."));
+      Parameters.Add(new LookupParameter<ItemList<BoolArray>>("Realizations", "The list of samples drawn from all possible stochastic instances."));
     }
 
@@ -100,12 +98,12 @@
     }
 
-    public static void Improve(Permutation assignment, DoubleMatrix distances, DoubleValue quality, IntValue localIterations, IntValue evaluatedSolutions, bool maximization, int maxIterations, CancellationToken cancellation, ItemList<ItemList<IntValue>> realizations) {
-      DistanceMatrix distanceM = (DistanceMatrix)distances;
-      for (int i = localIterations.Value; i < maxIterations; i++) {
+    public static void Improve(Permutation assignment, DoubleMatrix distances, DoubleValue quality, IntValue localIterations, IntValue evaluatedSolutions, bool maximization, int maxIterations, CancellationToken cancellation, ItemList<BoolArray> realizations) {
+      var distanceM = (DistanceMatrix)distances;
+      for (var i = localIterations.Value; i < maxIterations; i++) {
         TranslocationMove bestMove = null;
         double bestQuality = 0; // we have to make an improvement, so 0 is the baseline
         double evaluations = 0.0;
         foreach (var move in ExhaustiveInsertionMoveGenerator.Generate(assignment)) {
-          double moveQuality = PTSPEstimatedInsertionEvaluator.EvaluateByDistanceMatrix(assignment, move, distanceM, realizations);
+          double moveQuality = PTSPEstimatedInsertionMoveEvaluator.EvaluateByDistanceMatrix(assignment, move, distanceM, realizations);
           int min = Math.Min(move.Index1, move.Index3);
           int max = Math.Max(move.Index2, move.Index3 + (move.Index2 - move.Index1));
@@ -135,5 +133,5 @@
       var localIterations = LocalIterationsParameter.ActualValue;
       var evaluations = EvaluatedSolutionsParameter.ActualValue;
-      var realizations = RealizationsParameter.Value;
+      var realizations = RealizationsParameter.ActualValue;
       if (localIterations == null) {
         localIterations = new IntValue(0);
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Improvers/PTSPExhaustiveInversionLocalImprovement.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Improvers/PTSPExhaustiveInversionLocalImprovement.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Improvers/PTSPExhaustiveInversionLocalImprovement.cs	(revision 13412)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Threading;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -29,5 +30,4 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using System.Threading;
 
 namespace HeuristicLab.Problems.PTSP {
@@ -40,6 +40,6 @@
   [Item("PTSPExhaustiveInversionLocalImprovement", "An operator that improves probabilistic traveling salesman solutions. The operator tries to improve the probabilistic traveling salesman solution by swapping two randomly chosen edges for a certain number of times.")]
   [StorableClass]
-  public sealed class PTSPExhaustiveInversionLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator {
-  
+  public sealed class PTSPExhaustiveInversionLocalImprovement : SingleSuccessorOperator, IEstimatedPTSPOperator, ILocalImprovementOperator {
+
     public ILookupParameter<IntValue> LocalIterationsParameter {
       get { return (ILookupParameter<IntValue>)Parameters["LocalIterations"]; }
@@ -74,13 +74,11 @@
     }
 
-    public IValueParameter<ItemList<ItemList<IntValue>>> RealizationsParameter {
-      get { return (IValueParameter<ItemList<ItemList<IntValue>>>)Parameters["Realizations"]; }
+    public ILookupParameter<ItemList<BoolArray>> RealizationsParameter {
+      get { return (ILookupParameter<ItemList<BoolArray>>)Parameters["Realizations"]; }
     }
 
     [StorableConstructor]
-    protected PTSPExhaustiveInversionLocalImprovement(bool deserializing) : base(deserializing) { }
-    protected PTSPExhaustiveInversionLocalImprovement(PTSPExhaustiveInversionLocalImprovement original, Cloner cloner)
-      : base(original, cloner) {
-    }
+    private PTSPExhaustiveInversionLocalImprovement(bool deserializing) : base(deserializing) { }
+    private PTSPExhaustiveInversionLocalImprovement(PTSPExhaustiveInversionLocalImprovement original, Cloner cloner) : base(original, cloner) { }
     public PTSPExhaustiveInversionLocalImprovement()
       : base() {
@@ -93,5 +91,5 @@
       Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem should be maximized or minimized."));
       Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
-      Parameters.Add(new ValueParameter<ItemList<ItemList<IntValue>>>("Realizations", "The concrete..."));
+      Parameters.Add(new LookupParameter<ItemList<BoolArray>>("Realizations", "The list of samples drawn from all possible stochastic instances."));
     }
 
@@ -100,12 +98,12 @@
     }
 
-    public static void Improve(Permutation assignment, DoubleMatrix distances, DoubleValue quality, IntValue localIterations, IntValue evaluatedSolutions, bool maximization, int maxIterations, CancellationToken cancellation, ItemList<ItemList<IntValue>> realizations) {
-      DistanceMatrix distanceM = (DistanceMatrix)distances;
-      for (int i = localIterations.Value; i < maxIterations; i++) {
+    public static void Improve(Permutation assignment, DoubleMatrix distances, DoubleValue quality, IntValue localIterations, IntValue evaluatedSolutions, bool maximization, int maxIterations, CancellationToken cancellation, ItemList<BoolArray> realizations) {
+      var distanceM = (DistanceMatrix)distances;
+      for (var i = localIterations.Value; i < maxIterations; i++) {
         InversionMove bestMove = null;
         double bestQuality = 0; // we have to make an improvement, so 0 is the baseline
         double evaluations = 0.0;
         foreach (var move in ExhaustiveInversionMoveGenerator.Generate(assignment)) {
-          double moveQuality = PTSPEstimatedInversionEvaluator.EvaluateByDistanceMatrix(assignment, move, distanceM, realizations);
+          double moveQuality = PTSPEstimatedInversionMoveEvaluator.EvaluateByDistanceMatrix(assignment, move, distanceM, realizations);
           evaluations += 2 * (move.Index2 - move.Index1 + 1) / (double)assignment.Length;
           if (maximization && moveQuality > bestQuality
@@ -132,5 +130,5 @@
       var localIterations = LocalIterationsParameter.ActualValue;
       var evaluations = EvaluatedSolutionsParameter.ActualValue;
-      var realizations = RealizationsParameter.Value;
+      var realizations = RealizationsParameter.ActualValue;
       if (localIterations == null) {
         localIterations = new IntValue(0);
Index: anches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/I25MoveOperator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/I25MoveOperator.cs	(revision 13411)
+++ 	(revision )
@@ -1,13 +1,0 @@
-﻿using HeuristicLab.Core;
-using HeuristicLab.Optimization;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace HeuristicLab.Problems.PTSP {
-  public interface I25MoveOperator : IMoveOperator {
-    ILookupParameter<TwoPointFiveMove> TwoPointFiveMoveParameter { get; }
-  }
-}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IEstimatedPTSPMoveEvaluator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IEstimatedPTSPMoveEvaluator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IEstimatedPTSPMoveEvaluator.cs	(revision 13412)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Problems.PTSP {
+  public interface IEstimatedPTSPMoveEvaluator : IEstimatedPTSPOperator, ISingleObjectiveMoveEvaluator, IPermutationMoveOperator {
+    ILookupParameter<DoubleMatrix> CoordinatesParameter { get; }
+    ILookupParameter<DistanceMatrix> DistanceMatrixParameter { get; }
+    ILookupParameter<BoolValue> UseDistanceMatrixParameter { get; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IEstimatedPTSPOperator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IEstimatedPTSPOperator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IEstimatedPTSPOperator.cs	(revision 13412)
@@ -0,0 +1,29 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Problems.PTSP {
+  public interface IEstimatedPTSPOperator : IItem {
+    ILookupParameter<ItemList<BoolArray>> RealizationsParameter { get; }
+  }
+}
Index: anches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IPTSPMoveEvaluator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IPTSPMoveEvaluator.cs	(revision 13411)
+++ 	(revision )
@@ -1,36 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Optimization;
-using System;
-
-namespace HeuristicLab.Problems.PTSP {
-  public interface IPTSPMoveEvaluator : ISingleObjectiveMoveEvaluator, IMoveOperator, IPermutationMoveOperator {
-    Type EvaluatorType { get; }
-    ILookupParameter<DoubleMatrix> CoordinatesParameter { get; }
-    ILookupParameter<DistanceMatrix> DistanceMatrixParameter { get; }
-    ILookupParameter<BoolValue> UseDistanceMatrixParameter { get; }
-
-  }
-}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/ITwoPointFiveMoveOperator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/ITwoPointFiveMoveOperator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/ITwoPointFiveMoveOperator.cs	(revision 13412)
@@ -0,0 +1,29 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Problems.PTSP {
+  public interface ITwoPointFiveMoveOperator : IMoveOperator {
+    ILookupParameter<TwoPointFiveMove> TwoPointFiveMoveParameter { get; }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/EstimatedPTSPMoveEvaluator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/EstimatedPTSPMoveEvaluator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/EstimatedPTSPMoveEvaluator.cs	(revision 13412)
@@ -0,0 +1,103 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("EstimatedPTSPMoveEvaluator", "A base class for operators which evaluate TSP moves.")]
+  [StorableClass]
+  public abstract class EstimatedPTSPMoveEvaluator : SingleSuccessorOperator, IEstimatedPTSPMoveEvaluator {
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+    public ILookupParameter<DoubleMatrix> CoordinatesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
+    }
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+    public ILookupParameter<BoolValue> UseDistanceMatrixParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
+    }
+    public ILookupParameter<ItemList<BoolArray>> RealizationsParameter {
+      get { return (ILookupParameter<ItemList<BoolArray>>)Parameters["Realizations"]; }
+    }
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public ILookupParameter<DoubleValue> MoveQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
+    }
+    public ILookupParameter<DistanceCalculator> DistanceCalculatorParameter {
+      get { return (ILookupParameter<DistanceCalculator>)Parameters["DistanceCalculator"]; }
+    }
+
+    [StorableConstructor]
+    protected EstimatedPTSPMoveEvaluator(bool deserializing) : base(deserializing) { }
+    protected EstimatedPTSPMoveEvaluator(EstimatedPTSPMoveEvaluator original, Cloner cloner) : base(original, cloner) { }
+    protected EstimatedPTSPMoveEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
+      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The city's coordinates."));
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+      Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated (if it does not exist already) and used for evaluation, otherwise false."));
+      Parameters.Add(new LookupParameter<ItemList<BoolArray>>("Realizations", "The list of samples drawn from all possible stochastic instances."));
+      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of a TSP solution."));
+      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The evaluated quality of a move on a TSP solution."));
+      Parameters.Add(new LookupParameter<DistanceCalculator>("DistanceCalculator", "The class that can compute distances between coordinates."));
+    }
+
+    public override IOperation Apply() {
+      var permutation = PermutationParameter.ActualValue;
+      var coordinates = CoordinatesParameter.ActualValue;
+      double relativeQualityDifference = 0;
+      if (UseDistanceMatrixParameter.ActualValue.Value) {
+        var distanceMatrix = DistanceMatrixParameter.ActualValue;
+        if (distanceMatrix == null) throw new InvalidOperationException("The distance matrix has not been calculated.");
+        relativeQualityDifference = EvaluateByDistanceMatrix(permutation, distanceMatrix);
+      } else {
+        if (coordinates == null) throw new InvalidOperationException("No coordinates were given.");
+        var distanceCalculator = DistanceCalculatorParameter.ActualValue;
+        if (distanceCalculator == null) throw new InvalidOperationException("Distance calculator is null!");
+        relativeQualityDifference = EvaluateByCoordinates(permutation, coordinates, distanceCalculator);
+      }
+      var moveQuality = MoveQualityParameter.ActualValue;
+      if (moveQuality == null) MoveQualityParameter.ActualValue = new DoubleValue(QualityParameter.ActualValue.Value + relativeQualityDifference);
+      else moveQuality.Value = QualityParameter.ActualValue.Value + relativeQualityDifference;
+      return base.Apply();
+    }
+
+    protected abstract double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix);
+    protected abstract double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates, DistanceCalculator distanceCalculator);
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/OneShift/PTSPEstimatedInsertionMoveEvaluator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/OneShift/PTSPEstimatedInsertionMoveEvaluator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/OneShift/PTSPEstimatedInsertionMoveEvaluator.cs	(revision 13412)
@@ -0,0 +1,248 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("PTSPEstimatedInsertionMoveEvaluator", "Evaluates an insertion move (1-shift)")]
+  [StorableClass]
+  public class PTSPEstimatedInsertionMoveEvaluator : EstimatedPTSPMoveEvaluator, IPermutationTranslocationMoveOperator {
+
+    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
+      get { return (ILookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
+    }
+
+    [StorableConstructor]
+    protected PTSPEstimatedInsertionMoveEvaluator(bool deserializing) : base(deserializing) { }
+    protected PTSPEstimatedInsertionMoveEvaluator(PTSPEstimatedInsertionMoveEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public PTSPEstimatedInsertionMoveEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PTSPEstimatedInsertionMoveEvaluator(this, cloner);
+    }
+
+    public static double EvaluateByCoordinates(Permutation permutation, TranslocationMove move, DoubleMatrix coordinates, DistanceCalculator distanceCalculator, ItemList<BoolArray> realizations) {
+      var afterMove = new Permutation(PermutationTypes.RelativeUndirected, permutation);
+      TranslocationManipulator.Apply(afterMove, move.Index1, move.Index1, move.Index3);
+      double moveQuality = 0;
+      var edges = new int[12];
+      var indices = new int[12];
+      edges[0] = permutation.GetCircular(move.Index1 - 1);
+      indices[0] = DecreaseCircularIndex(permutation.Length, move.Index1);
+      edges[1] = permutation[move.Index1];
+      indices[1] = move.Index1;
+      edges[2] = permutation[move.Index1];
+      indices[2] = move.Index1;
+      edges[3] = permutation.GetCircular(move.Index1 + 1);
+      indices[3] = IncreaseCircularIndex(permutation.Length, move.Index1);
+
+      edges[6] = afterMove.GetCircular(move.Index3 - 1);
+      indices[6] = DecreaseCircularIndex(afterMove.Length, move.Index3);
+      edges[7] = afterMove[move.Index3];
+      indices[7] = move.Index3;
+      edges[8] = afterMove[move.Index3];
+      indices[8] = move.Index3;
+      edges[9] = afterMove.GetCircular(move.Index3 + 1);
+      indices[9] = IncreaseCircularIndex(afterMove.Length, move.Index3);
+
+      if (move.Index3 > move.Index1) {
+        edges[4] = permutation[move.Index3];
+        indices[4] = move.Index3;
+        edges[5] = permutation.GetCircular(move.Index3 + 1);
+        indices[5] = indices[9];
+        edges[10] = afterMove.GetCircular(move.Index1 - 1);
+        indices[10] = indices[0];
+        edges[11] = afterMove[move.Index1];
+        indices[11] = move.Index1;
+      } else {
+        edges[4] = permutation.GetCircular(move.Index3 - 1);
+        indices[4] = indices[6];
+        edges[5] = permutation[move.Index3];
+        indices[5] = move.Index3;
+        edges[10] = afterMove[move.Index1];
+        indices[10] = move.Index1;
+        edges[11] = afterMove.GetCircular(move.Index1 + 1);
+        indices[11] = indices[3];
+      }
+      int[] aPosteriori = new int[12];
+      foreach (var realization in realizations) {
+        for (int i = 0; i < edges.Length; i++) {
+          Permutation tempPermutation;
+          if (i < 6) {
+            tempPermutation = permutation;
+          } else {
+            tempPermutation = afterMove;
+          }
+          if (realization[edges[i]]) {
+            aPosteriori[i] = edges[i];
+          } else {
+            int j = 1;
+            if (i % 2 == 0) {
+              // find nearest predecessor in realization if source edge
+              while (!realization[tempPermutation.GetCircular(indices[i] - j)]) {
+                j++;
+              }
+              aPosteriori[i] = tempPermutation.GetCircular(indices[i] - j);
+            } else {
+              // find nearest successor in realization if target edge
+              while (!realization[tempPermutation.GetCircular(indices[i] + j)]) {
+                j++;
+              }
+              aPosteriori[i] = tempPermutation.GetCircular(indices[i] + j);
+            }
+          }
+        }
+        if (!(aPosteriori[0] == aPosteriori[2] && aPosteriori[1] == aPosteriori[3]) &&
+          !(aPosteriori[0] == aPosteriori[4] && aPosteriori[1] == aPosteriori[5]) &&
+          !(aPosteriori[2] == aPosteriori[4] && aPosteriori[3] == aPosteriori[5])) {
+          // compute cost difference between the two a posteriori solutions
+
+          moveQuality += distanceCalculator.Calculate(aPosteriori[6], aPosteriori[7], coordinates)
+                       + distanceCalculator.Calculate(aPosteriori[8], aPosteriori[9], coordinates)
+                       + distanceCalculator.Calculate(aPosteriori[10], aPosteriori[11], coordinates)
+                       - distanceCalculator.Calculate(aPosteriori[0], aPosteriori[1], coordinates)
+                       - distanceCalculator.Calculate(aPosteriori[2], aPosteriori[3], coordinates)
+                       - distanceCalculator.Calculate(aPosteriori[4], aPosteriori[5], coordinates);
+        }
+        Array.Clear(aPosteriori, 0, aPosteriori.Length);
+      }
+      // return average of cost differences
+      return moveQuality / realizations.Count;
+    }
+
+    public static double EvaluateByDistanceMatrix(Permutation permutation, TranslocationMove move, DistanceMatrix distanceMatrix, ItemList<BoolArray> realizations) {
+      var afterMove = new Permutation(PermutationTypes.RelativeUndirected, permutation);
+      TranslocationManipulator.Apply(afterMove, move.Index1, move.Index1, move.Index3);
+      double moveQuality = 0;
+      var edges = new int[12];
+      var indices = new int[12];
+      edges[0] = permutation.GetCircular(move.Index1 - 1);
+      indices[0] = DecreaseCircularIndex(permutation.Length, move.Index1);
+      edges[1] = permutation[move.Index1];
+      indices[1] = move.Index1;
+      edges[2] = permutation[move.Index1];
+      indices[2] = move.Index1;
+      edges[3] = permutation.GetCircular(move.Index1 + 1);
+      indices[3] = IncreaseCircularIndex(permutation.Length, move.Index1);
+
+      edges[6] = afterMove.GetCircular(move.Index3 - 1);
+      indices[6] = DecreaseCircularIndex(afterMove.Length, move.Index3);
+      edges[7] = afterMove[move.Index3];
+      indices[7] = move.Index3;
+      edges[8] = afterMove[move.Index3];
+      indices[8] = move.Index3;
+      edges[9] = afterMove.GetCircular(move.Index3 + 1);
+      indices[9] = IncreaseCircularIndex(afterMove.Length, move.Index3);
+
+      if (move.Index3 > move.Index1) {
+        edges[4] = permutation[move.Index3];
+        indices[4] = move.Index3;
+        edges[5] = permutation.GetCircular(move.Index3 + 1);
+        indices[5] = indices[9];
+        edges[10] = afterMove.GetCircular(move.Index1 - 1);
+        indices[10] = indices[0];
+        edges[11] = afterMove[move.Index1];
+        indices[11] = move.Index1;
+      } else {
+        edges[4] = permutation.GetCircular(move.Index3 - 1);
+        indices[4] = indices[6];
+        edges[5] = permutation[move.Index3];
+        indices[5] = move.Index3;
+        edges[10] = afterMove[move.Index1];
+        indices[10] = move.Index1;
+        edges[11] = afterMove.GetCircular(move.Index1 + 1);
+        indices[11] = indices[3];
+      }
+      int[] aPosteriori = new int[12];
+      foreach (var realization in realizations) {
+        for (int i = 0; i < edges.Length; i++) {
+          Permutation tempPermutation;
+          if (i < 6) {
+            tempPermutation = permutation;
+          } else {
+            tempPermutation = afterMove;
+          }
+          if (realization[edges[i]]) {
+            aPosteriori[i] = edges[i];
+          } else {
+            int j = 1;
+            if (i % 2 == 0) {
+              // find nearest predecessor in realization if source edge
+              while (!realization[tempPermutation.GetCircular(indices[i] - j)]) {
+                j++;
+              }
+              aPosteriori[i] = tempPermutation.GetCircular(indices[i] - j);
+            } else {
+              // find nearest successor in realization if target edge
+              while (!realization[tempPermutation.GetCircular(indices[i] + j)]) {
+                j++;
+              }
+              aPosteriori[i] = tempPermutation.GetCircular(indices[i] + j);
+            }
+          }
+        }
+        if (!(aPosteriori[0] == aPosteriori[2] && aPosteriori[1] == aPosteriori[3]) &&
+          !(aPosteriori[0] == aPosteriori[4] && aPosteriori[1] == aPosteriori[5]) &&
+          !(aPosteriori[2] == aPosteriori[4] && aPosteriori[3] == aPosteriori[5])) {
+          // compute cost difference between the two a posteriori solutions
+          moveQuality = moveQuality + distanceMatrix[aPosteriori[6], aPosteriori[7]] + distanceMatrix[aPosteriori[8], aPosteriori[9]] + distanceMatrix[aPosteriori[10], aPosteriori[11]];
+          moveQuality = moveQuality - distanceMatrix[aPosteriori[0], aPosteriori[1]] - distanceMatrix[aPosteriori[2], aPosteriori[3]] - distanceMatrix[aPosteriori[4], aPosteriori[5]];
+        }
+        Array.Clear(aPosteriori, 0, aPosteriori.Length);
+      }
+      // return average of cost differences
+      return moveQuality / realizations.Count;
+    }
+
+    private static int DecreaseCircularIndex(int length, int index) {
+      var result = index - 1;
+      if (result == -1) {
+        result = length - 1;
+      }
+      return result;
+    }
+
+    private static int IncreaseCircularIndex(int length, int index) {
+      var result = index + 1;
+      if (result == length + 1) {
+        result = 0;
+      }
+      return result;
+    }
+
+    protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates, DistanceCalculator distanceCalculator) {
+      return EvaluateByCoordinates(permutation, TranslocationMoveParameter.ActualValue, coordinates, distanceCalculator, RealizationsParameter.ActualValue);
+    }
+
+    protected override double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix) {
+      return EvaluateByDistanceMatrix(permutation, TranslocationMoveParameter.ActualValue, distanceMatrix, RealizationsParameter.ActualValue);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoOpt/PTSPEstimatedInversionMoveEvaluator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoOpt/PTSPEstimatedInversionMoveEvaluator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoOpt/PTSPEstimatedInversionMoveEvaluator.cs	(revision 13412)
@@ -0,0 +1,155 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("PTSPEstimatedInversionMoveEvaluator", "Evaluates an inversion move (2-opt) over several realizations of tours by summing up the length of all added edges and subtracting the length of all deleted edges.")]
+  [StorableClass]
+  public class PTSPEstimatedInversionMoveEvaluator : EstimatedPTSPMoveEvaluator, IPermutationInversionMoveOperator {
+
+    public ILookupParameter<InversionMove> InversionMoveParameter {
+      get { return (ILookupParameter<InversionMove>)Parameters["InversionMove"]; }
+    }
+
+    [StorableConstructor]
+    protected PTSPEstimatedInversionMoveEvaluator(bool deserializing) : base(deserializing) { }
+    protected PTSPEstimatedInversionMoveEvaluator(PTSPEstimatedInversionMoveEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public PTSPEstimatedInversionMoveEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PTSPEstimatedInversionMoveEvaluator(this, cloner);
+    }
+
+    public static double EvaluateByCoordinates(Permutation permutation, InversionMove move, DoubleMatrix coordinates, DistanceCalculator distanceCalculator, ItemList<BoolArray> realizations) {
+      double moveQuality = 0;
+      var edges = new int[4];
+      var indices = new int[4];
+      edges[0] = permutation.GetCircular(move.Index1 - 1);
+      indices[0] = move.Index1 - 1;
+      if (indices[0] == -1) indices[0] = permutation.Length - 1;
+      edges[1] = permutation[move.Index1];
+      indices[1] = move.Index1;
+      edges[2] = permutation[move.Index2];
+      indices[2] = move.Index2;
+      edges[3] = permutation.GetCircular(move.Index2 + 1);
+      indices[3] = move.Index2 + 1;
+      if (indices[3] == permutation.Length + 1) indices[3] = 0;
+      var aPosteriori = new int[4];
+      foreach (var realization in realizations) {
+        for (var i = 0; i < edges.Length; i++) {
+          if (realization[edges[i]]) {
+            aPosteriori[i] = edges[i];
+          } else {
+            var j = 1;
+            if (i % 2 == 0) {
+              // find nearest predecessor in realization if source edge
+              while (!realization[permutation.GetCircular(indices[i] - j)]) {
+                j++;
+              }
+              aPosteriori[i] = permutation.GetCircular(indices[i] - j);
+            } else {
+              // find nearest successor in realization if target edge
+              while (!realization[permutation.GetCircular(indices[i] + j)]) {
+                j++;
+              }
+              aPosteriori[i] = permutation.GetCircular(indices[i] + j);
+            }
+          }
+        }
+        // compute cost difference between the two a posteriori solutions
+        if (!(aPosteriori[0] == aPosteriori[2] && aPosteriori[1] == aPosteriori[3])) {
+          moveQuality = moveQuality
+            + distanceCalculator.Calculate(0, 2, coordinates)
+            + distanceCalculator.Calculate(1, 3, coordinates)
+            - distanceCalculator.Calculate(0, 1, coordinates)
+            - distanceCalculator.Calculate(2, 3, coordinates);
+        }
+        Array.Clear(aPosteriori, 0, aPosteriori.Length);
+      }
+      // return average of cost differences
+      return moveQuality / realizations.Count;
+    }
+
+    public static double EvaluateByDistanceMatrix(Permutation permutation, InversionMove move, DistanceMatrix distanceMatrix, ItemList<BoolArray> realizations) {
+      double moveQuality = 0;
+      var edges = new int[4];
+      var indices = new int[4];
+      edges[0] = permutation.GetCircular(move.Index1 - 1);
+      indices[0] = move.Index1 - 1;
+      if (indices[0] == -1) indices[0] = permutation.Length - 1;
+      edges[1] = permutation[move.Index1];
+      indices[1] = move.Index1;
+      edges[2] = permutation[move.Index2];
+      indices[2] = move.Index2;
+      edges[3] = permutation.GetCircular(move.Index2 + 1);
+      indices[3] = move.Index2 + 1;
+      if (indices[3] == permutation.Length + 1) indices[3] = 0;
+      var aPosteriori = new int[4];
+      foreach (var realization in realizations) {
+        for (var i = 0; i < edges.Length; i++) {
+          if (realization[edges[i]]) {
+            aPosteriori[i] = edges[i];
+          } else {
+            var j = 1;
+            if (i % 2 == 0) {
+              // find nearest predecessor in realization if source edge
+              while (!realization[permutation.GetCircular(indices[i] - j)]) {
+                j++;
+              }
+              aPosteriori[i] = permutation.GetCircular(indices[i] - j);
+            } else {
+              // find nearest successor in realization if target edge
+              while (!realization[permutation.GetCircular(indices[i] + j)]) {
+                j++;
+              }
+              aPosteriori[i] = permutation.GetCircular(indices[i] + j);
+            }
+          }
+        }
+        // compute cost difference between the two a posteriori solutions
+        if (!(aPosteriori[0] == aPosteriori[2] && aPosteriori[1] == aPosteriori[3])) {
+          moveQuality = moveQuality + distanceMatrix[aPosteriori[0], aPosteriori[2]] + distanceMatrix[aPosteriori[1], aPosteriori[3]] - distanceMatrix[aPosteriori[0], aPosteriori[1]] - distanceMatrix[aPosteriori[2], aPosteriori[3]];
+        }
+        Array.Clear(aPosteriori, 0, aPosteriori.Length);
+      }
+      // return average of cost differences
+      return moveQuality / realizations.Count;
+    }
+
+    protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates, DistanceCalculator distanceCalculator) {
+      return EvaluateByCoordinates(permutation, InversionMoveParameter.ActualValue, coordinates, distanceCalculator, RealizationsParameter.ActualValue);
+    }
+
+    protected override double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix) {
+      return EvaluateByDistanceMatrix(permutation, InversionMoveParameter.ActualValue, distanceMatrix, RealizationsParameter.ActualValue);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/ExhaustiveTwoPointFiveMoveGenerator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/ExhaustiveTwoPointFiveMoveGenerator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/ExhaustiveTwoPointFiveMoveGenerator.cs	(revision 13412)
@@ -0,0 +1,80 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Exhaustive 2.5-MoveGenerator", "Generates all possible inversion and shift moves (2.5-opt) from a given permutation.")]
+  [StorableClass]
+  public sealed class ExhaustiveTwoPointFiveMoveGenerator : TwoPointFiveMoveGenerator, IExhaustiveMoveGenerator {
+
+    [StorableConstructor]
+    private ExhaustiveTwoPointFiveMoveGenerator(bool deserializing) : base(deserializing) { }
+    private ExhaustiveTwoPointFiveMoveGenerator(ExhaustiveTwoPointFiveMoveGenerator original, Cloner cloner) : base(original, cloner) { }
+    public ExhaustiveTwoPointFiveMoveGenerator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ExhaustiveTwoPointFiveMoveGenerator(this, cloner);
+    }
+
+    public static TwoPointFiveMove[] Apply(Permutation permutation) {
+      return Generate(permutation).ToArray();
+    }
+
+    public static IEnumerable<TwoPointFiveMove> Generate(Permutation permutation) {
+      int length = permutation.Length;
+      if (length == 1) throw new ArgumentException("Exhaustive 2.5-MoveGenerator: There cannot be a 2.5 move given a permutation of length 1.", "permutation");
+      int totalMoves = (length) * (length - 1) / 2;
+
+      if (permutation.PermutationType == PermutationTypes.RelativeUndirected) {
+        if (totalMoves - 3 > 0) {
+          for (int i = 0; i < length - 1; i++) {
+            for (int j = i + 1; j < length; j++) {
+              // doesn't make sense to inverse the whole permutation or the whole but one in case of relative undirected permutations
+              if (j - i >= length - 2) continue;
+              yield return new TwoPointFiveMove(i, j, true);
+              yield return new TwoPointFiveMove(i, j, false);
+            }
+          }
+        } else { // when length is 3 or less, there's actually no difference, but for the sake of not crashing the algorithm create a dummy move
+          yield return new TwoPointFiveMove(0, 1, true);
+        }
+      } else {
+        for (int i = 0; i < length - 1; i++)
+          for (int j = i + 1; j < length; j++) {
+            yield return new TwoPointFiveMove(i, j, true);
+            yield return new TwoPointFiveMove(i, j, false);
+          }
+      }
+    }
+
+    protected override TwoPointFiveMove[] GenerateMoves(Permutation permutation) {
+      return Apply(permutation);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/PTSPTwoPointFiveMoveEvaluator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/PTSPTwoPointFiveMoveEvaluator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/PTSPTwoPointFiveMoveEvaluator.cs	(revision 13412)
@@ -0,0 +1,86 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("PTSP 2.5-MoveEvaluator", "Operator that evaluates 2.5-p-opt moves of PTSP")]
+  [StorableClass]
+  public class PTSPTwoPointFiveMoveEvaluator : EstimatedPTSPMoveEvaluator, ITwoPointFiveMoveOperator {
+
+    public ILookupParameter<TwoPointFiveMove> TwoPointFiveMoveParameter {
+      get { return (ILookupParameter<TwoPointFiveMove>)Parameters["TwoPointFiveMove"]; }
+    }
+
+    [StorableConstructor]
+    protected PTSPTwoPointFiveMoveEvaluator(bool deserializing) : base(deserializing) { }
+    protected PTSPTwoPointFiveMoveEvaluator(PTSPTwoPointFiveMoveEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public PTSPTwoPointFiveMoveEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<TwoPointFiveMove>("TwoPointFiveMove", "The move to evaluate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PTSPTwoPointFiveMoveEvaluator(this, cloner);
+    }
+
+    protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates, DistanceCalculator distanceCalculator) {
+      var move = TwoPointFiveMoveParameter.ActualValue;
+      var realizations = RealizationsParameter.ActualValue;
+      return EvaluateByCoordinates(permutation, coordinates, distanceCalculator, move, realizations);
+    }
+
+    public static double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates, DistanceCalculator distanceCalculator, TwoPointFiveMove move, ItemList<BoolArray> realizations) {
+      if (move.IsInvert) {
+        return PTSPEstimatedInversionMoveEvaluator.EvaluateByCoordinates(permutation,
+          new InversionMove(move.Index1, move.Index2, move.Permutation),
+          coordinates, distanceCalculator, realizations);
+      } else {
+        return PTSPEstimatedInsertionMoveEvaluator.EvaluateByCoordinates(permutation,
+          new TranslocationMove(move.Index1, move.Index1, move.Index2),
+          coordinates, distanceCalculator, realizations);
+      }
+    }
+
+    protected override double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix) {
+      var move = TwoPointFiveMoveParameter.ActualValue;
+      var realizations = RealizationsParameter.ActualValue;
+      return EvaluateByDistanceMatrix(permutation, distanceMatrix, move, realizations);
+    }
+
+    public static double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix, TwoPointFiveMove move, ItemList<BoolArray> realizations) {
+      if (move.IsInvert) {
+        return PTSPEstimatedInversionMoveEvaluator.EvaluateByDistanceMatrix(permutation,
+          new InversionMove(move.Index1, move.Index2, move.Permutation),
+          distanceMatrix, realizations);
+      } else {
+        return PTSPEstimatedInsertionMoveEvaluator.EvaluateByDistanceMatrix(permutation,
+          new TranslocationMove(move.Index1, move.Index1, move.Index2),
+          distanceMatrix, realizations);
+      }
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/StochasticTwoPointFiveMultiMoveGenerator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/StochasticTwoPointFiveMultiMoveGenerator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/StochasticTwoPointFiveMultiMoveGenerator.cs	(revision 13412)
@@ -0,0 +1,71 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Stochastic 2.5-MultiMoveGenerator", "Randomly samples n from all possible inversion and shift moves (2.5-opt) from a given permutation.")]
+  [StorableClass]
+  public sealed class StochasticTwoPointFiveMultiMoveGenerator : TwoPointFiveMoveGenerator, IMultiMoveGenerator, IStochasticOperator {
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    public IValueLookupParameter<IntValue> SampleSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["SampleSize"]; }
+    }
+
+    public IntValue SampleSize {
+      get { return SampleSizeParameter.Value; }
+      set { SampleSizeParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    private StochasticTwoPointFiveMultiMoveGenerator(bool deserializing) : base(deserializing) { }
+    private StochasticTwoPointFiveMultiMoveGenerator(StochasticTwoPointFiveMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { }
+    public StochasticTwoPointFiveMultiMoveGenerator()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new StochasticTwoPointFiveMultiMoveGenerator(this, cloner);
+    }
+
+    public static TwoPointFiveMove[] Apply(Permutation permutation, IRandom random, int sampleSize) {
+      var moves = new TwoPointFiveMove[sampleSize];
+      for (var i = 0; i < sampleSize; i++) {
+        moves[i] = StochasticTwoPointFiveSingleMoveGenerator.Apply(permutation, random);
+      }
+      return moves;
+    }
+
+    protected override TwoPointFiveMove[] GenerateMoves(Permutation permutation) {
+      return Apply(permutation, RandomParameter.ActualValue, SampleSizeParameter.ActualValue.Value);
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/StochasticTwoPointFiveSingleMoveGenerator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/StochasticTwoPointFiveSingleMoveGenerator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/StochasticTwoPointFiveSingleMoveGenerator.cs	(revision 13412)
@@ -0,0 +1,70 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("Stochastic 2.5-SingleMoveGenerator", "Randomly samples a single from all possible inversion and shift moves (2.5-opt) from a given permutation.")]
+  [StorableClass]
+  public sealed class StochasticTwoPointFiveSingleMoveGenerator : TwoPointFiveMoveGenerator, IStochasticOperator, ISingleMoveGenerator {
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+
+    [StorableConstructor]
+    private StochasticTwoPointFiveSingleMoveGenerator(bool deserializing) : base(deserializing) { }
+    private StochasticTwoPointFiveSingleMoveGenerator(StochasticTwoPointFiveSingleMoveGenerator original, Cloner cloner) : base(original, cloner) { }
+    public StochasticTwoPointFiveSingleMoveGenerator()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new StochasticTwoPointFiveSingleMoveGenerator(this, cloner);
+    }
+
+    public static TwoPointFiveMove Apply(Permutation permutation, IRandom random) {
+      int length = permutation.Length;
+      if (length == 1) throw new ArgumentException("Stochastic 2.5-SingleMoveGenerator: There cannot be an inversion move given a permutation of length 1.", "permutation");
+      int index1 = random.Next(length - 1);
+      int index2 = random.Next(index1 + 1, length);
+      if (permutation.PermutationType == PermutationTypes.RelativeUndirected) {
+        if (length > 3) {
+          while (index2 - index1 >= length - 2)
+            index2 = random.Next(index1 + 1, length);
+        }
+      }
+      bool isInvert = random.NextDouble() > 0.5;
+      return new TwoPointFiveMove(index1, index2, isInvert);
+
+    }
+
+    protected override TwoPointFiveMove[] GenerateMoves(Permutation permutation) {
+      return new[] { Apply(permutation, RandomParameter.ActualValue) };
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/TwoPointFiveMove.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/TwoPointFiveMove.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/TwoPointFiveMove.cs	(revision 13412)
@@ -1,3 +1,24 @@
-﻿using HeuristicLab.Common;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Encodings.PermutationEncoding;
@@ -5,16 +26,25 @@
 
 namespace HeuristicLab.Problems.PTSP {
-  public class TwoPointFiveMove : Item {
-    
+  [Item("2.5-Move", "Represents a 2.5-move.")]
+  [StorableClass]
+  public sealed class TwoPointFiveMove : Item {
+    [Storable]
+    public int Index1 { get; protected set; }
+    [Storable]
+    public int Index2 { get; protected set; }
+    [Storable]
+    public Permutation Permutation { get; protected set; }
+    [Storable]
+    public bool IsInvert { get; protected set; }
+
     [StorableConstructor]
-    public TwoPointFiveMove() : this(-1, -1,null, true) { }
-    protected TwoPointFiveMove(bool deserializing) : base(deserializing) { }
-    protected TwoPointFiveMove(TwoPointFiveMove original, Cloner cloner)
+    public TwoPointFiveMove() : this(-1, -1, null, true) { }
+    private TwoPointFiveMove(bool deserializing) : base(deserializing) { }
+    private TwoPointFiveMove(TwoPointFiveMove original, Cloner cloner)
       : base(original, cloner) {
       this.Index1 = original.Index1;
       this.Index2 = original.Index2;
       this.IsInvert = original.IsInvert;
-      if (original.Permutation != null)
-        this.Permutation = cloner.Clone(original.Permutation);
+      this.Permutation = cloner.Clone(original.Permutation);
     }
     public TwoPointFiveMove(int index1, int index2, Permutation permutation, bool isinvert)
@@ -34,13 +64,4 @@
     }
 
-    [Storable]
-    public int Index1 { get; protected set; }
-    [Storable]
-    public int Index2 { get; protected set; }
-    [Storable]
-    public Permutation Permutation { get; protected set; }
-    [Storable]
-    public bool IsInvert { get; protected set; }
-
     public override IDeepCloneable Clone(Cloner cloner) {
       return new TwoPointFiveMove(this, cloner);
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/TwoPointFiveMoveGenerator.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/TwoPointFiveMoveGenerator.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/TwoPointFiveMoveGenerator.cs	(revision 13412)
@@ -0,0 +1,70 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("TwoPointFiveMoveGenerator", "Base class for all inversion and shift (2.5-opt) move generators.")]
+  [StorableClass]
+  public abstract class TwoPointFiveMoveGenerator : SingleSuccessorOperator, ITwoPointFiveMoveOperator, IMoveGenerator {
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+    public ILookupParameter<TwoPointFiveMove> TwoPointFiveMoveParameter {
+      get { return (LookupParameter<TwoPointFiveMove>)Parameters["TwoPointFiveMove"]; }
+    }
+
+    [StorableConstructor]
+    protected TwoPointFiveMoveGenerator(bool deserializing) : base(deserializing) { }
+    protected TwoPointFiveMoveGenerator(TwoPointFiveMoveGenerator original, Cloner cloner) : base(original, cloner) { }
+    protected TwoPointFiveMoveGenerator()
+      : base() {
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation for which moves should be generated."));
+      Parameters.Add(new LookupParameter<TwoPointFiveMove>("TwoPointFiveMove", "The moves that should be generated in subscopes."));
+      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes."));
+    }
+
+    public override IOperation Apply() {
+      var p = PermutationParameter.ActualValue;
+      var moves = GenerateMoves(p);
+      var moveScopes = new Scope[moves.Length];
+      for (int i = 0; i < moveScopes.Length; i++) {
+        moveScopes[i] = new Scope(i.ToString());
+        moveScopes[i].Variables.Add(new Variable(TwoPointFiveMoveParameter.ActualName, moves[i]));
+      }
+      ExecutionContext.Scope.SubScopes.AddRange(moveScopes);
+      return base.Apply();
+    }
+
+    protected abstract TwoPointFiveMove[] GenerateMoves(Permutation permutation);
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/TwoPointFiveMoveMaker.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/TwoPointFiveMoveMaker.cs	(revision 13412)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Moves/TwoPointFiveOpt/TwoPointFiveMoveMaker.cs	(revision 13412)
@@ -0,0 +1,84 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.PTSP {
+  [Item("TwoPointFiveMoveMaker", "Peforms an inversion and shift (2.5-opt) on a given permutation and updates the quality.")]
+  [StorableClass]
+  public class TwoPointFiveMoveMaker : SingleSuccessorOperator, ITwoPointFiveMoveOperator, IMoveMaker {
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public ILookupParameter<DoubleValue> MoveQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
+    }
+    public ILookupParameter<TwoPointFiveMove> TwoPointFiveMoveParameter {
+      get { return (ILookupParameter<TwoPointFiveMove>)Parameters["TwoPointFiveMove"]; }
+    }
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+
+    [StorableConstructor]
+    protected TwoPointFiveMoveMaker(bool deserializing) : base(deserializing) { }
+    protected TwoPointFiveMoveMaker(TwoPointFiveMoveMaker original, Cloner cloner) : base(original, cloner) { }
+    public TwoPointFiveMoveMaker()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution."));
+      Parameters.Add(new LookupParameter<TwoPointFiveMove>("TwoPointFiveMove", "The move to evaluate."));
+      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move."));
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TwoPointFiveMoveMaker(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var move = TwoPointFiveMoveParameter.ActualValue;
+      var permutation = PermutationParameter.ActualValue;
+      var moveQuality = MoveQualityParameter.ActualValue;
+      var quality = QualityParameter.ActualValue;
+
+      if (move.IsInvert) {
+        InversionManipulator.Apply(permutation, move.Index1, move.Index2);
+      } else {
+        TranslocationManipulator.Apply(permutation, move.Index1, move.Index1, move.Index2);
+      }
+
+      quality.Value = moveQuality.Value;
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSP.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSP.cs	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSP.cs	(revision 13412)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -30,7 +31,7 @@
 
 namespace HeuristicLab.Problems.PTSP {
-  [Item("Probabilistic Traveling Salesman Problem", "Represents a Probabilistic Traveling Salesman Problem.")]
+  [Item("Probabilistic Traveling Salesman Problem (PTSP)", "Represents a Probabilistic Traveling Salesman Problem.")]
   [StorableClass]
-  public abstract class ProbabilisticTravelingSalesmanProblem : SingleObjectiveBasicProblem<PermutationEncoding>, IStorableContent,
+  public abstract class ProbabilisticTravelingSalesmanProblem : SingleObjectiveBasicProblem<PermutationEncoding>,
   IProblemInstanceConsumer<PTSPData> {
     private static readonly int DistanceMatrixSizeLimit = 1000;
@@ -40,18 +41,19 @@
       get { return (OptionalValueParameter<DoubleMatrix>)Parameters["Coordinates"]; }
     }
+    public OptionalValueParameter<DistanceCalculator> DistanceCalculatorParameter {
+      get { return (OptionalValueParameter<DistanceCalculator>)Parameters["DistanceCalculator"]; }
+    }
     public OptionalValueParameter<DistanceMatrix> DistanceMatrixParameter {
       get { return (OptionalValueParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
     }
-    public ValueParameter<BoolValue> UseDistanceMatrixParameter {
-      get { return (ValueParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
+    public IFixedValueParameter<BoolValue> UseDistanceMatrixParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
     }
     public OptionalValueParameter<Permutation> BestKnownSolutionParameter {
       get { return (OptionalValueParameter<Permutation>)Parameters["BestKnownSolution"]; }
     }
-    public ValueParameter<DoubleArray> ProbabilityMatrixParameter {
-      get { return (ValueParameter<DoubleArray>)Parameters["ProbabilityMatrix"]; }
+    public IValueParameter<DoubleArray> ProbabilitiesParameter {
+      get { return (IValueParameter<DoubleArray>)Parameters["Probabilities"]; }
     }
-
-
     #endregion
 
@@ -61,11 +63,15 @@
       set { CoordinatesParameter.Value = value; }
     }
+    public DistanceCalculator DistanceCalculator {
+      get { return DistanceCalculatorParameter.Value; }
+      set { DistanceCalculatorParameter.Value = value; }
+    }
     public DistanceMatrix DistanceMatrix {
       get { return DistanceMatrixParameter.Value; }
       set { DistanceMatrixParameter.Value = value; }
     }
-    public BoolValue UseDistanceMatrix {
-      get { return UseDistanceMatrixParameter.Value; }
-      set { UseDistanceMatrixParameter.Value = value; }
+    public bool UseDistanceMatrix {
+      get { return UseDistanceMatrixParameter.Value.Value; }
+      set { UseDistanceMatrixParameter.Value.Value = value; }
     }
     public Permutation BestKnownSolution {
@@ -73,11 +79,10 @@
       set { BestKnownSolutionParameter.Value = value; }
     }
-    public DoubleArray ProbabilityMatrix {
-      get { return ProbabilityMatrixParameter.Value; }
-      set { ProbabilityMatrixParameter.Value = value; }
+    public DoubleArray Probabilities {
+      get { return ProbabilitiesParameter.Value; }
+      set { ProbabilitiesParameter.Value = value; }
     }
 
     #endregion
-
 
     public override bool Maximization {
@@ -87,14 +92,12 @@
     [StorableConstructor]
     protected ProbabilisticTravelingSalesmanProblem(bool deserializing) : base(deserializing) { }
-    protected ProbabilisticTravelingSalesmanProblem(ProbabilisticTravelingSalesmanProblem original, Cloner cloner)
-      : base(original, cloner) {
-    }
-
-    public ProbabilisticTravelingSalesmanProblem() {
+    protected ProbabilisticTravelingSalesmanProblem(ProbabilisticTravelingSalesmanProblem original, Cloner cloner) : base(original, cloner) { }
+    protected ProbabilisticTravelingSalesmanProblem() {
       Parameters.Add(new OptionalValueParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
+      Parameters.Add(new OptionalValueParameter<DistanceCalculator>("DistanceCalculator", "Calculates the distance between two rows in the coordinates matrix."));
       Parameters.Add(new OptionalValueParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
-      Parameters.Add(new ValueParameter<BoolValue>("UseDistanceMatrix", "True if the coordinates based evaluators should calculate the distance matrix from the coordinates and use it for evaluation similar to the distance matrix evaluator, otherwise false.", new BoolValue(true)));
+      Parameters.Add(new FixedValueParameter<BoolValue>("UseDistanceMatrix", "True if the coordinates based evaluators should calculate the distance matrix from the coordinates and use it for evaluation similar to the distance matrix evaluator, otherwise false.", new BoolValue(true)));
       Parameters.Add(new OptionalValueParameter<Permutation>("BestKnownSolution", "The best known solution of this TSP instance."));
-      Parameters.Add(new ValueParameter<DoubleArray>("ProbabilityMatrix", "The matrix which contains the probabilities of each of the cities."));
+      Parameters.Add(new ValueParameter<DoubleArray>("Probabilities", "This list describes for each city the probability of appearing in a realized instance."));
 
       Coordinates = new DoubleMatrix(new double[,] {
@@ -105,27 +108,44 @@
       });
 
-      ProbabilityMatrix = new DoubleArray(new double[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
+      Probabilities = new DoubleArray(new double[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
+    }
 
+    public override double Evaluate(Individual individual, IRandom random) {
+      return Evaluate(individual.Permutation(), random);
     }
+
+    public abstract double Evaluate(Permutation tour, IRandom random);
 
     public virtual void Load(PTSPData data) {
       if (data.Coordinates == null && data.Distances == null)
         throw new System.IO.InvalidDataException("The given instance specifies neither coordinates nor distances!");
-      if (data.Dimension > DistanceMatrixSizeLimit && (data.DistanceMeasure == DistanceMeasure.Att
-        || data.DistanceMeasure == DistanceMeasure.Manhattan
-        || data.DistanceMeasure == DistanceMeasure.Maximum))
-        throw new System.IO.InvalidDataException("The given instance uses an unsupported distance measure and is too large for using a distance matrix.");
-      if (data.Coordinates != null && data.Coordinates.GetLength(1) != 2)
-        throw new System.IO.InvalidDataException("The coordinates of the given instance are not in the right format, there need to be one row for each customer and two columns for the x and y coordinates.");
+      if (data.Dimension > DistanceMatrixSizeLimit && (data.Coordinates == null || data.Coordinates.GetLength(0) != data.Dimension || data.Coordinates.GetLength(1) != 2))
+        throw new System.IO.InvalidDataException("The given instance is too large for using a distance matrix and there is a problem with the coordinates.");
+      if (data.Coordinates != null && (data.Coordinates.GetLength(0) != data.Dimension || data.Coordinates.GetLength(1) != 2))
+        throw new System.IO.InvalidDataException("The coordinates of the given instance are not in the right format, there need to be one row for each customer and two columns for the x and y coordinates respectively.");
+
+      switch (data.DistanceMeasure) {
+        case DistanceMeasure.Direct:
+          DistanceCalculator = null;
+          if (data.Dimension > DistanceMatrixSizeLimit && Coordinates != null) {
+            DistanceCalculator = new EuclideanDistance();
+            UseDistanceMatrix = false;
+          } else UseDistanceMatrix = true;
+          break;
+        case DistanceMeasure.Att: DistanceCalculator = new AttDistance(); break;
+        case DistanceMeasure.Euclidean: DistanceCalculator = new EuclideanDistance(); break;
+        case DistanceMeasure.Geo: DistanceCalculator = new GeoDistance(); break;
+        case DistanceMeasure.Manhattan: DistanceCalculator = new ManhattanDistance(); break;
+        case DistanceMeasure.Maximum: DistanceCalculator = new MaximumDistance(); break;
+        case DistanceMeasure.RoundedEuclidean: DistanceCalculator = new RoundedEuclideanDistance(); break;
+        case DistanceMeasure.UpperEuclidean: DistanceCalculator = new UpperEuclideanDistance(); break;
+        default: throw new ArgumentException("Distance measure is unknown");
+      }
 
       Name = data.Name;
       Description = data.Description;
 
-      ProbabilityMatrix = new DoubleArray(data.Probabilities);
-
-      if (data.BestKnownTour != null) {
-        BestKnownSolution = new Permutation(PermutationTypes.RelativeUndirected, data.BestKnownTour);
-      }
-
+      Probabilities = new DoubleArray(data.Probabilities);
+      BestKnownSolution = data.BestKnownTour != null ? new Permutation(PermutationTypes.RelativeUndirected, data.BestKnownTour) : null;
       Coordinates = data.Coordinates != null && data.Coordinates.GetLength(0) > 0 ? new DoubleMatrix(data.Coordinates) : null;
       DistanceMatrix = new DistanceMatrix(data.GetDistanceMatrix());
Index: anches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSPData.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSPData.cs	(revision 13411)
+++ 	(revision )
@@ -1,11 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.Problems.Instances;
-
-namespace HeuristicLab.Problems.PTSP {
-  public class PTSPData : TSPData {
-    public double[] Probabilities { get; set; }
-  }
-}
Index: anches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSPLIBInstanceProvider.cs
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSPLIBInstanceProvider.cs	(revision 13411)
+++ 	(revision )
@@ -1,142 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.IO;
-using System.IO.Compression;
-using System.Linq;
-using HeuristicLab.Problems.Instances;
-using HeuristicLab.Problems.Instances.TSPLIB;
-
-namespace HeuristicLab.Problems.PTSP {
-  public class PTSPLIBInstanceProvider : TSPLIBInstanceProvider<PTSPData> {
-
-    public override string Name {
-      get { return "(P)TSPLIB (symmetric TSP)"; }
-    }
-
-    public override string Description {
-      get { return "Adaption of the Traveling Salesman Problem Library for probabilistic instances"; }
-    }
-
-    protected override string FileExtension { get { return "tsp"; } }
-
-    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
-      Dictionary<string, string> solutions = new Dictionary<string, string>();
-      var solutionsArchiveName = GetResourceName(FileExtension + @"\.opt\.tour\.zip");
-      if (!String.IsNullOrEmpty(solutionsArchiveName)) {
-        using (var solutionsZipFile = new ZipArchive(typeof(TSPLIBTSPInstanceProvider).Assembly.GetManifestResourceStream(solutionsArchiveName), ZipArchiveMode.Read)) {
-          foreach (var entry in solutionsZipFile.Entries)
-            solutions.Add(entry.Name.Substring(0, entry.Name.Length - ".opt.tour".Length) + "." + FileExtension, entry.Name);
-        }
-      }
-      var instanceArchiveName = GetResourceName(FileExtension + @"\.zip");
-      if (String.IsNullOrEmpty(instanceArchiveName)) yield break;
-
-      using (var instanceStream = new ZipArchive(typeof(TSPLIBTSPInstanceProvider).Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) {
-        foreach (var entry in instanceStream.Entries.Select(x => x.Name).OrderBy(x => x)) {
-          yield return new PTSPDataDescriptor(Path.GetFileNameWithoutExtension(entry), GetInstanceDescription(), entry, solutions.ContainsKey(entry) ? solutions[entry] : String.Empty);
-        }
-      }
-    }
-
-    public override PTSPData LoadData(IDataDescriptor id) {
-      var descriptor = (PTSPDataDescriptor)id;
-      var instanceArchiveName = GetResourceName(FileExtension + @"\.zip");
-      using (var instancesZipFile = new ZipArchive(typeof(TSPLIBTSPInstanceProvider).Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) {
-        var entry = instancesZipFile.GetEntry(descriptor.InstanceIdentifier);
-        var stream = entry.Open();
-        var parser = new TSPLIBParser(stream);
-        var instance = LoadInstance(parser);
-
-        if (!String.IsNullOrEmpty(descriptor.SolutionIdentifier)) {
-          var solutionsArchiveName = GetResourceName(FileExtension + @"\.opt\.tour\.zip");
-          using (var solutionsZipFile = new ZipArchive(typeof(TSPLIBTSPInstanceProvider).Assembly.GetManifestResourceStream(solutionsArchiveName), ZipArchiveMode.Read)) {
-            entry = solutionsZipFile.GetEntry(descriptor.SolutionIdentifier);
-            stream = entry.Open();
-            parser = new TSPLIBParser(stream);
-            LoadSolution(parser, instance);
-          }
-        }
-
-        return instance;
-      }
-    }
-
-    protected override PTSPData LoadInstance(TSPLIBParser parser) {
-      parser.Parse();
-      if (parser.FixedEdges != null) throw new InvalidDataException("TSP instance " + parser.Name + " contains fixed edges which are not supported by HeuristicLab.");
-      var instance = new PTSPData();
-      instance.Dimension = parser.Dimension;
-      instance.Coordinates = parser.Vertices ?? parser.DisplayVertices;
-      instance.Distances = parser.Distances;
-      switch (parser.EdgeWeightType) {
-        case TSPLIBEdgeWeightTypes.ATT:
-          instance.DistanceMeasure = DistanceMeasure.Att; break;
-        case TSPLIBEdgeWeightTypes.CEIL_2D:
-          instance.DistanceMeasure = DistanceMeasure.UpperEuclidean; break;
-        case TSPLIBEdgeWeightTypes.EUC_2D:
-          instance.DistanceMeasure = DistanceMeasure.RoundedEuclidean; break;
-        case TSPLIBEdgeWeightTypes.EUC_3D:
-          throw new InvalidDataException("3D coordinates are not supported.");
-        case TSPLIBEdgeWeightTypes.EXPLICIT:
-          instance.DistanceMeasure = DistanceMeasure.Direct; break;
-        case TSPLIBEdgeWeightTypes.GEO:
-          instance.DistanceMeasure = DistanceMeasure.Geo; break;
-        case TSPLIBEdgeWeightTypes.MAN_2D:
-          instance.DistanceMeasure = DistanceMeasure.Manhattan; break;
-        case TSPLIBEdgeWeightTypes.MAN_3D:
-          throw new InvalidDataException("3D coordinates are not supported.");
-        case TSPLIBEdgeWeightTypes.MAX_2D:
-          instance.DistanceMeasure = DistanceMeasure.Maximum; break;
-        case TSPLIBEdgeWeightTypes.MAX_3D:
-          throw new InvalidDataException("3D coordinates are not supported.");
-        default:
-          throw new InvalidDataException("The given edge weight is not supported by HeuristicLab.");
-      }
-
-      // use own hash function in case the implementation of String.GetHashCode() changes
-      // ... and hope that System.Random doesn't change
-      var random = new System.Random(Hash(parser.Name));
-      instance.Probabilities = Enumerable.Range(0, parser.Dimension).Select(x => random.NextDouble() * 0.8 + 0.1).ToArray();
-      instance.Name = parser.Name;
-      instance.Description = parser.Comment
-        + Environment.NewLine + Environment.NewLine
-        + GetInstanceDescription();
-      return instance;
-    }
-
-    protected override void LoadSolution(TSPLIBParser parser, PTSPData instance) {
-      // the TSP optimal tour isn't necessarily the PTSP optimal tour
-    }
-
-    public PTSPData LoadData(string tspFile, double? bestQuality) {
-      var data = LoadInstance(new TSPLIBParser(tspFile));
-      if (bestQuality.HasValue)
-        data.BestKnownQuality = bestQuality.Value;
-      return data;
-    }
-
-    private int Hash(string s) {
-      var h = 3571;
-      unchecked {
-        for (var i = 0; i < s.Length; i++)
-          h = h * 31 + s[i];
-      }
-      return h;
-    }
-  }
-
-  internal class PTSPDataDescriptor : IDataDescriptor {
-    public string Name { get; internal set; }
-    public string Description { get; internal set; }
-
-    internal string InstanceIdentifier { get; set; }
-    internal string SolutionIdentifier { get; set; }
-
-    internal PTSPDataDescriptor(string name, string description, string instanceIdentifier, string solutionIdentifier) {
-      this.Name = name;
-      this.Description = description;
-      this.InstanceIdentifier = instanceIdentifier;
-      this.SolutionIdentifier = solutionIdentifier;
-    }
-  }
-}
Index: /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Plugin.cs.frame
===================================================================
--- /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Plugin.cs.frame	(revision 13411)
+++ /branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Plugin.cs.frame	(revision 13412)
@@ -1,19 +1,41 @@
-﻿using HeuristicLab.PluginInfrastructure;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.PluginInfrastructure;
+
 namespace HeuristicLab.Problems.PTSP {
-    [Plugin("HeuristicLab.Problems.PTSP", "Provides an implementation of the PTSP", "3.3.11.$WCREV$")]
-    [PluginFile("HeuristicLab.Problems.PTSP-3.3.dll", PluginFileType.Assembly)]
-	[PluginDependency("HeuristicLab.Collections", "3.3")]
-	[PluginDependency("HeuristicLab.Common", "3.3")]
-	[PluginDependency("HeuristicLab.Common.Resources", "3.3")]
-	[PluginDependency("HeuristicLab.Core", "3.3")]
-	[PluginDependency("HeuristicLab.Data", "3.3")]
-	[PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
-	[PluginDependency("HeuristicLab.Operators", "3.3")]
-	[PluginDependency("HeuristicLab.Optimization", "3.3")]
-	[PluginDependency("HeuristicLab.Parameters", "3.3")]
-	[PluginDependency("HeuristicLab.Persistence", "3.3")]
-	[PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
-	[PluginDependency("HeuristicLab.Random", "3.3")]
-    public class Plugin : PluginBase {
-    }
+  [Plugin("HeuristicLab.Problems.PTSP", "Provides an implementation of the probabilistic traveling salesman problem (PTSP)", "3.3.13.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.PTSP-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
+  [PluginDependency("HeuristicLab.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  public class HeuristicLabProblemsPTSPPlugin : PluginBase {
+  }
 }
Index: /branches/PTSP/PTSP.sln
===================================================================
--- /branches/PTSP/PTSP.sln	(revision 13411)
+++ /branches/PTSP/PTSP.sln	(revision 13412)
@@ -2,5 +2,5 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 2013
-VisualStudioVersion = 12.0.31101.0
+VisualStudioVersion = 12.0.40629.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.PTSP-3.3", "HeuristicLab.Problems.PTSP\3.3\HeuristicLab.Problems.PTSP-3.3.csproj", "{97198965-AFEA-496B-B3B1-316905C43FD6}"
@@ -10,22 +10,66 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.PTSP.Tests-3.3", "HeuristicLab.Problems.PTSP.Tests-3.3\HeuristicLab.Problems.PTSP.Tests-3.3.csproj", "{CBEC171A-F7EC-460D-94E2-D58625811D99}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.Instances.TSPLIB-3.3", "HeuristicLab.Problems.Instances.TSPLIB\3.3\HeuristicLab.Problems.Instances.TSPLIB-3.3.csproj", "{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.Instances-3.3", "HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj", "{3540E29E-4793-49E7-8EE2-FEA7F61C3994}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
 		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{97198965-AFEA-496B-B3B1-316905C43FD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{97198965-AFEA-496B-B3B1-316905C43FD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{97198965-AFEA-496B-B3B1-316905C43FD6}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{97198965-AFEA-496B-B3B1-316905C43FD6}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{97198965-AFEA-496B-B3B1-316905C43FD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{97198965-AFEA-496B-B3B1-316905C43FD6}.Release|Any CPU.Build.0 = Release|Any CPU
+		{97198965-AFEA-496B-B3B1-316905C43FD6}.Release|x64.ActiveCfg = Release|Any CPU
+		{97198965-AFEA-496B-B3B1-316905C43FD6}.Release|x86.ActiveCfg = Release|Any CPU
 		{90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Release|x64.ActiveCfg = Release|Any CPU
+		{90B6CA12-9791-4430-B2D7-CD3ED7F75E2B}.Release|x86.ActiveCfg = Release|Any CPU
 		{CBEC171A-F7EC-460D-94E2-D58625811D99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{CBEC171A-F7EC-460D-94E2-D58625811D99}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CBEC171A-F7EC-460D-94E2-D58625811D99}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{CBEC171A-F7EC-460D-94E2-D58625811D99}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{CBEC171A-F7EC-460D-94E2-D58625811D99}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{CBEC171A-F7EC-460D-94E2-D58625811D99}.Release|Any CPU.Build.0 = Release|Any CPU
+		{CBEC171A-F7EC-460D-94E2-D58625811D99}.Release|x64.ActiveCfg = Release|Any CPU
+		{CBEC171A-F7EC-460D-94E2-D58625811D99}.Release|x86.ActiveCfg = Release|Any CPU
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Debug|x64.ActiveCfg = Debug|x64
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Debug|x64.Build.0 = Debug|x64
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Debug|x86.ActiveCfg = Debug|x86
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Debug|x86.Build.0 = Debug|x86
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Release|x64.ActiveCfg = Release|x64
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Release|x64.Build.0 = Release|x64
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Release|x86.ActiveCfg = Release|x86
+		{CE0F99D6-1C56-48A9-9B68-3E5B833703EF}.Release|x86.Build.0 = Release|x86
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Debug|x64.ActiveCfg = Debug|x64
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Debug|x64.Build.0 = Debug|x64
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Debug|x86.ActiveCfg = Debug|x86
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Debug|x86.Build.0 = Debug|x86
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Release|Any CPU.Build.0 = Release|Any CPU
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Release|x64.ActiveCfg = Release|x64
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Release|x64.Build.0 = Release|x64
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Release|x86.ActiveCfg = Release|x86
+		{3540E29E-4793-49E7-8EE2-FEA7F61C3994}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
