Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj	(revision 4360)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj	(revision 4360)
@@ -0,0 +1,214 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{6410BDA6-3641-42B2-BABA-AA626E2F6F71}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.VehicleRouting</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.VehicleRouting-3.4</AssemblyName>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>
+    </DocumentationFile>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>bin\Release\HeuristicLab.Problems.VehicleRouting-3.4.xml</DocumentationFile>
+    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>bin\x86\Release\HeuristicLab.Routing.TSP-3.3.xml</DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>bin\x64\Release\HeuristicLab.Routing.TSP-3.3.XML</DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ORLIBParser.cs" />
+    <Compile Include="TSPLIBParser.cs" />
+    <Compile Include="VRPUtilities.cs" />
+    <Compile Include="HeuristicLabProblemsVehicleRoutingPlugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SolomonParser.cs" />
+    <Compile Include="VehicleRoutingProblem.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
+      <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
+      <Name>HeuristicLab.Analysis-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
+      <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
+      <Name>HeuristicLab.Collections-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
+      <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
+      <Name>HeuristicLab.Common.Resources-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
+      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
+      <Name>HeuristicLab.Common-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
+      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
+      <Name>HeuristicLab.Core-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
+      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
+      <Name>HeuristicLab.Data-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.PermutationEncoding\3.3\HeuristicLab.Encodings.PermutationEncoding-3.3.csproj">
+      <Project>{DBECB8B0-B166-4133-BAF1-ED67C3FD7FCA}</Project>
+      <Name>HeuristicLab.Encodings.PermutationEncoding-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
+      <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
+      <Name>HeuristicLab.Operators-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">
+      <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project>
+      <Name>HeuristicLab.Optimization.Operators-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
+      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
+      <Name>HeuristicLab.Optimization-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
+      <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
+      <Name>HeuristicLab.Parameters-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
+      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
+      <Name>HeuristicLab.Persistence-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="HeuristicLabProblemsVehicleRoutingPlugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Encodings\" />
+    <Folder Include="Interfaces\" />
+    <Folder Include="ProblemInstances\" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- 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>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabProblemsVehicleRoutingPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabProblemsVehicleRoutingPlugin.cs"</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLabProblemsVehicleRoutingPlugin.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLabProblemsVehicleRoutingPlugin.cs	(revision 4360)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLabProblemsVehicleRoutingPlugin.cs	(revision 4360)
@@ -0,0 +1,44 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.VehicleRouting {
+  /// <summary>
+  /// Plugin class for HeuristicLab.Problems.VehicleRouting plugin
+  /// </summary>
+  [Plugin("HeuristicLab.Problems.VehicleRouting", "3.4.0.4347")]
+  [PluginFile("HeuristicLab.Problems.VehicleRouting-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [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.Optimization.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  public class HeuristicLabProblemsVehicleRoutingPlugin : PluginBase {
+  }
+}
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLabProblemsVehicleRoutingPlugin.cs.frame
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLabProblemsVehicleRoutingPlugin.cs.frame	(revision 4360)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLabProblemsVehicleRoutingPlugin.cs.frame	(revision 4360)
@@ -0,0 +1,44 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.VehicleRouting {
+  /// <summary>
+  /// Plugin class for HeuristicLab.Problems.VehicleRouting plugin
+  /// </summary>
+  [Plugin("HeuristicLab.Problems.VehicleRouting", "3.4.0.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.VehicleRouting-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [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.Optimization.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  public class HeuristicLabProblemsVehicleRoutingPlugin : PluginBase {
+  }
+}
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ORLIBParser.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ORLIBParser.cs	(revision 4360)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ORLIBParser.cs	(revision 4360)
@@ -0,0 +1,120 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Text;
+using System.IO;
+using System.Globalization;
+
+namespace HeuristicLab.Problems.VehicleRouting {
+  class ORLIBParser {
+    private StreamReader source;
+    CultureInfo culture = new CultureInfo("en-US");
+    
+    private string name;
+    public string Name {
+      get {
+        return name;
+      }
+    }
+
+    private double[,] vertices;
+    public double[,] Vertices {
+      get { 
+        return vertices; 
+      }
+    }
+
+    private double capacity;
+    public double Capacity {
+      get {
+        return capacity;
+      }
+    }
+
+    private double maxRouteTime;
+    public double MaxRouteTime {
+      get {
+        return maxRouteTime;
+      }
+    }
+
+    private double serviceTime;
+    public double ServiceTime {
+      get {
+        return serviceTime;
+      }
+    }
+
+    private double[] demands;
+    public double[] Demands {
+      get {
+        return demands;
+      }
+    }
+
+    public ORLIBParser(String path) {
+      source = null;
+      
+      name = path;
+      vertices = null;
+      capacity = -1;
+      maxRouteTime = -1;
+      serviceTime = -1;
+      demands = null;
+    }
+
+    public void Parse() {
+      using (source = new StreamReader(name)) {
+        //Read header
+        string line = source.ReadLine();
+        string[] tokens = line.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
+
+        int customers = int.Parse(tokens[0]);
+        demands = new double[customers + 1];
+        demands[0] = 0;
+        vertices = new double[customers + 1, 2];
+
+        capacity = int.Parse(tokens[1]);
+        maxRouteTime = int.Parse(tokens[2]);
+        serviceTime = int.Parse(tokens[3]);
+
+        //Read depot
+        line = source.ReadLine();
+        tokens = line.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
+        vertices[0, 0] = double.Parse(tokens[0], culture.NumberFormat);
+        vertices[0, 1] = double.Parse(tokens[1], culture.NumberFormat);
+
+        for (int i = 0; i < customers; i++) {
+          line = source.ReadLine();
+          tokens = line.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
+          vertices[i + 1, 0] = double.Parse(tokens[0], culture.NumberFormat);
+          vertices[i + 1, 1] = double.Parse(tokens[1], culture.NumberFormat);
+          demands[i + 1] = double.Parse(tokens[2], culture.NumberFormat);
+        }
+      }
+
+      source = null;
+    }
+  }
+}
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Properties/AssemblyInfo.frame
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Properties/AssemblyInfo.frame	(revision 4360)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Properties/AssemblyInfo.frame	(revision 4360)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.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.VehicleRouting")]
+[assembly: AssemblyDescription("HeuristicLab Vehicle Routing Problem classes")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2010 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("91E21AF8-7C70-48de-A71B-6422ABB33764")]
+
+// 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 Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.0.$WCREV$")]
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/SolomonParser.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/SolomonParser.cs	(revision 4360)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/SolomonParser.cs	(revision 4360)
@@ -0,0 +1,156 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Text.RegularExpressions;
+
+namespace HeuristicLab.Problems.VehicleRouting {
+  class SolomonParser {
+    private string file;
+    private string problemName;
+    private int cities;
+    private int vehicles;
+    private double capacity;
+    private List<double> xCoord;
+    private List<double> yCoord;
+    private List<double> demand;
+    private List<double> readyTime;
+    private List<double> dueTime;
+    private List<double> serviceTime;
+
+    public int Cities {
+      get {
+        return cities;
+      }
+    }
+
+    public int Vehicles {
+      get {
+        return vehicles;
+      }
+    }
+
+    public double Capacity {
+      get {
+        return capacity;
+      }
+    }
+
+    public double[,] Coordinates {
+      get {
+        double[] x = xCoord.ToArray();
+        double[] y = yCoord.ToArray();
+        double[,] coord = new double[x.Length, 2];
+        for (int i = 0; i < x.Length; i++) {
+          coord[i, 0] = x[i];
+          coord[i, 1] = y[i];
+        }
+        return coord;
+      }
+    }
+
+    public double[] Demands {
+      get {
+        return demand.ToArray();
+      }
+    }
+
+    public double[] Readytimes {
+      get {
+        return readyTime.ToArray();
+      }
+    }
+
+    public double[] Duetimes {
+      get {
+        return dueTime.ToArray();
+      }
+    }
+
+    public double[] Servicetimes {
+      get {
+        return serviceTime.ToArray();
+      }
+    }
+
+    public String ProblemName {
+      get {
+        return problemName;
+      }
+    }
+
+    public SolomonParser(string file) {
+      this.file = file;
+      xCoord = new List<double>();
+      yCoord = new List<double>();
+      demand = new List<double>();
+      readyTime = new List<double>();
+      dueTime = new List<double>();
+      serviceTime = new List<double>();
+    }
+
+    public void Parse() {
+      string line;
+      Regex reg = new Regex(@"-?\d+");
+      MatchCollection m;
+
+      StreamReader reader = new StreamReader(file);
+
+      problemName = reader.ReadLine();
+      for (int i = 0; i < 3; i++) {
+        reader.ReadLine();
+      }
+      line = reader.ReadLine();
+
+      m = reg.Matches(line);
+      if (m.Count != 2)
+        throw new InvalidDataException("File has wrong format!");
+
+      vehicles = int.Parse(m[0].Value);
+      capacity = double.Parse(m[1].Value);
+
+      for (int i = 0; i < 4; i++) {
+        reader.ReadLine();
+      }
+
+      line = reader.ReadLine();
+      while ((line != null) && (line.Length > 5)) {
+        m = reg.Matches(line);
+        if (m.Count != 7) { continue; }
+        xCoord.Add((double)int.Parse(m[1].Value));
+        yCoord.Add((double)int.Parse(m[2].Value));
+        demand.Add((double)int.Parse(m[3].Value));
+        readyTime.Add((double)int.Parse(m[4].Value));
+        double st = (double)int.Parse(m[6].Value);
+        dueTime.Add((double)int.Parse(m[5].Value));
+        serviceTime.Add(st);
+        line = reader.ReadLine();
+      }
+      cities = serviceTime.Count;
+    }
+
+    internal string OnReset() {
+      throw new NotImplementedException();
+    }
+  }
+}
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/TSPLIBParser.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/TSPLIBParser.cs	(revision 4360)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/TSPLIBParser.cs	(revision 4360)
@@ -0,0 +1,402 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Globalization;
+using System.IO;
+
+namespace HeuristicLab.Problems.VehicleRouting {
+  /// <summary>
+  /// Parses a *.vrp file in TSPLIB format and extracts its information about a VRP.
+  /// </summary>
+  public class TSPLIBParser {
+    #region Inner Enum TSPLIBEdgeWeightType
+    public enum TSPLIBEdgeWeightType {
+      UNDEFINED,
+      EUC_2D,
+      GEO
+    }
+    #endregion
+
+    private const int EOF = 0;
+    private const int NAME = 1;
+    private const int TYPE = 2;
+    private const int COMMENT = 3;
+    private const int DIM = 4;
+    private const int WEIGHTTYPE = 5;
+    private const int WEIGHTFORMAT = 11;
+    private const int NODETYPE = 6;
+    private const int NODESECTION = 7;
+    private const int CAPACITY = 8;
+    private const int DISTANCE = 12;
+    private const int VEHICLES = 13;
+    private const int DEPOTSECTION = 9;
+    private const int DEMANDSECTION = 10;
+
+    private StreamReader source;
+    private bool alternateFormat;
+    CultureInfo culture = new CultureInfo("en-US");
+
+    private string name;
+    /// <summary>
+    /// Gets the name of the parsed VRP.
+    /// </summary>
+    public string Name {
+      get { return name; }
+    }
+    private string comment;
+    /// <summary>
+    /// Gets the comment of the parsed VRP.
+    /// </summary>
+    public string Comment {
+      get { return comment; }
+    }
+    private double[,] vertices;
+    /// <summary>
+    /// Gets the vertices of the parsed VRP.
+    /// </summary>
+    public double[,] Vertices {
+      get { return vertices; }
+    }
+    private TSPLIBEdgeWeightType weightType;
+    /// <summary>
+    /// Gets the weight format of the parsed VRP.
+    /// </summary>
+    public TSPLIBEdgeWeightType WeightType {
+      get { return weightType; }
+    }
+
+    private double capacity;
+    public double Capacity {
+      get {
+        return capacity;
+      }
+    }
+
+    private double distance;
+    public double Distance {
+      get {
+        return distance;
+      }
+    }
+
+    private int vehicles;
+    public int Vehicles {
+      get {
+        return vehicles;
+      }
+    }
+
+    private int depot;
+    public int Depot {
+      get {
+        return depot;
+      }
+    }
+
+    private double[] demands;
+    public double[] Demands {
+      get {
+        return demands;
+      }
+    }
+
+    /// <summary>
+    /// Initializes a new instance of <see cref="TSPLIBParser"/> with the given <paramref name="path"/>.
+    /// </summary>
+    /// <exception cref="ArgumentException">Thrown if the input file is not a TSPLIB TSP file (*.vrp)
+    /// </exception>
+    /// <param name="path">The path where the VRP is stored.</param>
+    public TSPLIBParser(String path) {
+      if (!path.EndsWith(".vrp"))
+        throw new ArgumentException("Input file has to be a TSPLIB CVRP file (*.vrp, *.txt).");
+
+      source = null;
+      name = path;
+      comment = string.Empty;
+      vertices = null;
+      weightType = TSPLIBEdgeWeightType.UNDEFINED;
+      capacity = -1;
+      distance = -1;
+      vehicles = -1;
+      depot = -1;
+      demands = null;
+      alternateFormat = false;
+    }
+
+    /// <summary>
+    /// Reads the TSPLIB VRP 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() {
+      using (source = new StreamReader(name)) {
+        int section = -1;
+        string str = null;
+        bool typeIsChecked = false;
+        bool weightTypeIsChecked = false;
+        bool weightFormatIsChecked = false;
+
+        do {
+          str = source.ReadLine();
+          section = GetSection(str);
+
+          if (section != -1) {
+            switch (section) {
+              case NAME:
+                ReadName(str);
+                break;
+              case TYPE:
+                CheckType(str);
+                typeIsChecked = true;
+                break;
+              case COMMENT:
+                ReadComment(str);
+                break;
+              case DIM:
+                InitArrays(str);
+                break;
+              case WEIGHTTYPE:
+                ReadWeightType(str);
+                weightTypeIsChecked = true;
+                break;
+              case WEIGHTFORMAT:
+                ReadWeightFormat(str);
+                weightFormatIsChecked = true;
+                break;
+              case NODETYPE:
+                CheckNodeType(str);
+                break;
+              case NODESECTION:
+                ReadVertices();
+                break;
+              case CAPACITY:
+                ReadCapacity(str);
+                break;
+              case DISTANCE:
+                ReadDistance(str);
+                break;
+              case VEHICLES:
+                ReadVehicles(str);
+                break;
+              case DEPOTSECTION:
+                ReadDepot();
+                break;
+              case DEMANDSECTION:
+                ReadDemands();
+                break;
+            }
+          }
+        } while (!((section == EOF) || (str == null)));
+
+        if (!typeIsChecked || !weightTypeIsChecked || 
+          (alternateFormat && !weightFormatIsChecked) || 
+          weightType == TSPLIBEdgeWeightType.UNDEFINED)
+          throw new InvalidDataException("Input file does not contain format or edge weight format information.");
+      }
+      source = null;
+    }
+
+    private int GetSection(string str) {
+      if (str == null)
+        return EOF;
+
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+      if (tokens.Length == 0)
+        return -1;
+
+      string token = tokens[0].Trim();
+      if (token.Equals("eof", StringComparison.OrdinalIgnoreCase))
+        return EOF;
+      if (token.Equals("name", StringComparison.OrdinalIgnoreCase))
+        return NAME;
+      if (token.Equals("type", StringComparison.OrdinalIgnoreCase))
+        return TYPE;
+      if (token.Equals("comment", StringComparison.OrdinalIgnoreCase))
+        return COMMENT;
+      if (token.Equals("dimension", StringComparison.OrdinalIgnoreCase))
+        return DIM;
+      if (token.Equals("edge_weight_type", StringComparison.OrdinalIgnoreCase))
+        return WEIGHTTYPE;
+      if (token.Equals("edge_weight_format", StringComparison.OrdinalIgnoreCase))
+        return WEIGHTFORMAT;
+      if (token.Equals("node_coord_type", StringComparison.OrdinalIgnoreCase))
+        return NODETYPE;
+      if (token.Equals("node_coord_section", StringComparison.OrdinalIgnoreCase))
+        return NODESECTION;
+      if (token.Equals("capacity", StringComparison.OrdinalIgnoreCase))
+        return CAPACITY;
+      if (token.Equals("distance", StringComparison.OrdinalIgnoreCase))
+        return DISTANCE;
+      if (token.Equals("vehicles", StringComparison.OrdinalIgnoreCase))
+        return VEHICLES;
+      if (token.Equals("depot_section", StringComparison.OrdinalIgnoreCase))
+        return DEPOTSECTION;
+      if (token.Equals("demand_section", StringComparison.OrdinalIgnoreCase))
+        return DEMANDSECTION;
+
+      return -1;
+    }
+
+    private void ReadName(string str) {
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+      name = tokens[tokens.Length - 1].Trim();
+    }
+
+    private void CheckType(string str) {
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+
+      string type = tokens[tokens.Length - 1].Trim();
+      if (!type.Equals("cvrp", StringComparison.OrdinalIgnoreCase))
+        throw new InvalidDataException("Input file format is not \"CVRP\"");
+    }
+
+    private void ReadComment(string str) {
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+      comment = tokens[tokens.Length - 1].Trim();
+    }
+
+    private void InitArrays(string str) {
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+      string dimension = tokens[tokens.Length - 1].Trim();
+
+      int dim = Int32.Parse(dimension);
+      vertices = new double[dim, 2];
+      demands = new double[dim];
+    }
+
+    private void ReadWeightType(string str) {
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+      string type = tokens[tokens.Length - 1].Trim();
+
+      if (type.Equals("euc_2d", StringComparison.OrdinalIgnoreCase))
+        weightType = TSPLIBEdgeWeightType.EUC_2D;
+      else if (type.Equals("geo", StringComparison.OrdinalIgnoreCase))
+        weightType = TSPLIBEdgeWeightType.GEO;
+      else if (type.Equals("function", StringComparison.OrdinalIgnoreCase)) {
+        weightType = TSPLIBEdgeWeightType.UNDEFINED;
+        alternateFormat = true;
+      } else
+        throw new InvalidDataException("Input file contains an unsupported edge weight format (only \"EUC_2D\" and \"GEO\" are supported).");
+    }
+
+    private void ReadWeightFormat(string str) {
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+      string format = tokens[tokens.Length - 1].Trim();
+
+      if (alternateFormat && format.Equals("euc_2d", StringComparison.OrdinalIgnoreCase))
+        weightType = TSPLIBEdgeWeightType.EUC_2D;
+      else if (format.Equals("geo", StringComparison.OrdinalIgnoreCase))
+        weightType = TSPLIBEdgeWeightType.GEO;
+      else
+        throw new InvalidDataException("Input file contains an unsupported edge weight format.");
+    }
+
+    private void CheckNodeType(string str) {
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+      string type = tokens[tokens.Length - 1].Trim();
+
+      if (!type.Equals("twod_coords", StringComparison.OrdinalIgnoreCase))
+        throw new InvalidDataException("Input file contains an unsupported node coordinates format (only \"TWOD_COORDS\" is supported).");
+    }
+
+    private void ReadVertices() {
+      if (vertices == null)
+        throw new InvalidDataException("Input file does not contain dimension information.");
+
+      for (int i = 0; i < (vertices.Length / 2); i++) {
+        if (!(alternateFormat && i == 0)) {
+          string str = source.ReadLine();
+          string[] tokens = str.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
+
+          if (tokens.Length != 3)
+            throw new InvalidDataException("Input file contains invalid node coordinates.");
+
+          vertices[i, 0] = double.Parse(tokens[1], culture.NumberFormat);
+          vertices[i, 1] = double.Parse(tokens[2], culture.NumberFormat);
+        }
+      }
+    }
+
+    private void ReadCapacity(string str) {
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+      capacity = double.Parse(tokens[tokens.Length - 1].Trim(), culture.NumberFormat);
+    }
+
+    private void ReadDistance(string str) {
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+      distance = double.Parse(tokens[tokens.Length - 1].Trim(), culture.NumberFormat);
+    }
+
+    private void ReadVehicles(string str) {
+      string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None);
+      vehicles = int.Parse(tokens[tokens.Length - 1].Trim());
+    }
+
+    private void ReadDepot() {
+      if (alternateFormat) {
+        string[] tokens;
+        do { 
+          string str = source.ReadLine();
+          tokens = str.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
+
+          if (tokens.Length == 2) {
+            vertices[0, 0] = double.Parse(tokens[0], culture.NumberFormat);
+            vertices[0, 1] = double.Parse(tokens[1], culture.NumberFormat);
+            depot = 1;
+          }
+        } while(tokens.Length == 2);
+      } else {
+        int read;
+        do {
+          string str = source.ReadLine();
+          read = int.Parse(str);
+          if (read != -1)
+            depot = read;
+        } while (read != -1);
+      }
+    }
+
+    private void ReadDemands() {
+      if (demands == null)
+        throw new InvalidDataException("Input file does not contain dimension information.");
+
+      for (int i = 0; i < demands.Length; i++) {
+        if (!(alternateFormat && i == 0)) {
+          string str = source.ReadLine();
+          string[] tokens = str.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
+
+          if (tokens.Length != 2)
+            throw new InvalidDataException("Input file contains invalid demands.");
+
+          int index = int.Parse(tokens[0]);
+          double value = double.Parse(tokens[1]);
+
+          if (alternateFormat)
+            demands[index] = value;
+          else
+            demands[index - 1] = value;
+        } else {
+          demands[0] = 0;
+        }
+      }
+    }
+  }
+}
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VRPUtilities.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VRPUtilities.cs	(revision 4360)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VRPUtilities.cs	(revision 4360)
@@ -0,0 +1,92 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Drawing;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.VehicleRouting {
+  public sealed class VRPUtilities {
+    public static double CalculateDistance(int start, int end, DoubleMatrix coordinates) {
+      double distance = 0.0;
+
+      distance =
+          Math.Sqrt(
+            Math.Pow(coordinates[start, 0] - coordinates[end, 0], 2) +
+            Math.Pow(coordinates[start, 1] - coordinates[end, 1], 2));
+
+      return distance;
+    }
+
+    private static DoubleMatrix CreateDistanceMatrix(DoubleMatrix coordinates) {
+      DoubleMatrix distanceMatrix = new DoubleMatrix(coordinates.Rows, coordinates.Rows);
+
+      for (int i = 0; i < distanceMatrix.Rows; i++) {
+        for (int j = i; j < distanceMatrix.Columns; j++) {
+          double distance = CalculateDistance(i, j, coordinates);
+
+          distanceMatrix[i, j] = distance;
+          distanceMatrix[j, i] = distance;
+        }
+      }
+
+      return distanceMatrix;
+    }
+
+    public static double GetDistance(int start, int end,
+      DoubleMatrix coordinates, ILookupParameter<DoubleMatrix> distanceMatrix, BoolValue useDistanceMatrix) {
+      double distance = 0.0;
+
+      if (useDistanceMatrix.Value) {
+        if (distanceMatrix is IValueLookupParameter<DoubleMatrix> &&
+          (distanceMatrix as IValueLookupParameter<DoubleMatrix>).Value != null) {
+            distance = (distanceMatrix as IValueLookupParameter<DoubleMatrix>).Value[start, end];
+        } else {
+          if (distanceMatrix.ActualValue == null) {
+            distanceMatrix.ActualValue = CreateDistanceMatrix(coordinates);
+          }
+
+          distance = distanceMatrix.ActualValue[start, end];
+        }       
+      } else {
+        distance = CalculateDistance(start, end, coordinates);
+      }
+
+      return distance;
+    }
+
+    public static double GetDistance(int start, int end,
+      DoubleMatrix coordinates, DoubleMatrix distanceMatrix, BoolValue useDistanceMatrix) {
+      double distance = 0.0;
+
+      if (useDistanceMatrix.Value) {
+        distance = distanceMatrix[start, end];
+      } else {
+        distance = CalculateDistance(start, end, coordinates);
+      }
+
+      return distance;
+    }
+  }
+}
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs	(revision 4360)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs	(revision 4360)
@@ -0,0 +1,220 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Drawing;
+using System.Linq;
+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;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.VehicleRouting {
+  [Item("Vehicle Routing Problem", "Represents a Vehicle Routing Problem.")]
+  [Creatable("Problems")]
+  [StorableClass]
+  public sealed class VehicleRoutingProblem : ParameterizedNamedItem, ISingleObjectiveProblem {
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; }
+    }
+
+    #region ISingleObjectiveProblem Members
+    public IParameter BestKnownQualityParameter {
+      get { throw new NotImplementedException(); }
+    }
+
+    public ISingleObjectiveEvaluator Evaluator {
+      get { throw new NotImplementedException(); }
+    }
+
+    #endregion
+
+    #region IProblem Members
+    public IParameter SolutionCreatorParameter {
+      get { throw new NotImplementedException(); }
+    }
+
+    public ISolutionCreator SolutionCreator {
+      get { throw new NotImplementedException(); }
+    }
+
+    public IParameter EvaluatorParameter {
+      get { throw new NotImplementedException(); }
+    }
+
+    IEvaluator IProblem.Evaluator {
+      get { throw new NotImplementedException(); }
+    }
+
+    public IEnumerable<IOperator> Operators {
+      get { throw new NotImplementedException(); }
+    }
+    #endregion
+
+    #region Parameter Properties
+    public ValueParameter<BoolValue> MaximizationParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    IParameter ISingleObjectiveProblem.MaximizationParameter {
+      get { return MaximizationParameter; }
+    }
+    #endregion
+
+    #region Properties
+   
+    #endregion
+
+    [Storable]
+    private List<IOperator> operators;
+
+    [StorableConstructor]
+    private VehicleRoutingProblem(bool deserializing) : base(deserializing) { }
+    public VehicleRoutingProblem()
+      : base() {
+      Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to false as the Vehicle Routing Problem is a minimization problem.", new BoolValue(false)));
+   
+      InitializeRandomVRPInstance();
+
+      ParameterizeSolutionCreator();
+      ParameterizeEvaluator();
+
+      InitializeOperators();
+      AttachEventHandlers();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      VehicleRoutingProblem clone = (VehicleRoutingProblem)base.Clone(cloner);
+      clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList();
+      clone.AttachEventHandlers();
+      return clone;
+    }
+
+    #region Events
+    public event EventHandler SolutionCreatorChanged;
+    private void OnSolutionCreatorChanged() {
+      EventHandler handler = SolutionCreatorChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    public event EventHandler EvaluatorChanged;
+    private void OnEvaluatorChanged() {
+      EventHandler handler = EvaluatorChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    public event EventHandler OperatorsChanged;
+    private void OnOperatorsChanged() {
+      EventHandler handler = OperatorsChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    public event EventHandler Reset;
+    private void OnReset() {
+      EventHandler handler = Reset;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }  
+    #endregion
+
+    #region Helpers
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserializationHook() {
+      AttachEventHandlers();
+    }
+
+    private void AttachEventHandlers() {
+     
+    }
+    private void InitializeOperators() {
+      operators = new List<IOperator>();
+      ParameterizeAnalyzer();
+      //operators.AddRange(ApplicationManager.Manager.GetInstances<IVRPOperator>().Cast<IOperator>().OrderBy(op => op.Name));
+      ParameterizeOperators();
+      UpdateMoveEvaluators();
+      InitializeMoveGenerators();
+    }
+    private void InitializeMoveGenerators() {
+      
+    }
+    private void UpdateMoveEvaluators() {
+      ParameterizeOperators();
+      OnOperatorsChanged();
+    }
+    private void ParameterizeSolutionCreator() {
+     
+    }
+    private void ParameterizeEvaluator() {
+      
+    }
+    private void ParameterizeAnalyzer() {
+     
+    }
+    private void ParameterizeOperators() {
+      
+    }
+    private void ClearDistanceMatrix() {
+      
+    }
+    #endregion
+
+    public void ImportFromSolomon(string solomonFileName) {
+      SolomonParser parser = new SolomonParser(solomonFileName);
+      parser.Parse();
+
+      this.Name = parser.ProblemName;
+
+      OnReset();
+    }
+
+    public void ImportFromTSPLib(string tspFileName) {
+      TSPLIBParser parser = new TSPLIBParser(tspFileName);
+      parser.Parse();
+
+      this.Name = parser.Name;
+      int problemSize = parser.Demands.Length;
+
+      if (parser.Depot != 1)
+        throw new Exception("Invalid depot specification");
+
+      if (parser.WeightType != TSPLIBParser.TSPLIBEdgeWeightType.EUC_2D)
+        throw new Exception("Invalid weight type");
+
+      OnReset();
+    }
+
+    public void ImportFromORLib(string orFileName) {
+      ORLIBParser parser = new ORLIBParser(orFileName);
+      parser.Parse();
+
+      this.Name = parser.Name;
+      int problemSize = parser.Demands.Length;
+
+      OnReset();
+    }
+
+    private void InitializeRandomVRPInstance() {
+      System.Random rand = new System.Random();
+
+      int cities = 100;
+    }
+  }
+}
