Changeset 7958


Ignore:
Timestamp:
06/05/12 08:34:36 (9 years ago)
Author:
svonolfe
Message:

Merged changes from trunk into branch (#1177)

Location:
branches/VRP
Files:
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4

  • branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4/HeuristicLab.Problems.Instances.VehicleRouting.Views-3.4.csproj

    r7903 r7958  
    1818    <DebugType>full</DebugType>
    1919    <Optimize>false</Optimize>
    20     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     20    <OutputPath>..\..\bin\</OutputPath>
    2121    <DefineConstants>DEBUG;TRACE</DefineConstants>
    2222    <ErrorReport>prompt</ErrorReport>
  • branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4/VRPInstanceProviderView.cs

    r7882 r7958  
    2121
    2222using System;
     23using System.IO;
    2324using System.Windows.Forms;
    2425using HeuristicLab.MainForm;
    2526using HeuristicLab.MainForm.WindowsForms;
    2627using HeuristicLab.Problems.Instances.Views;
    27 using System.IO;
    2828
    2929namespace HeuristicLab.Problems.Instances.VehicleRouting.Views {
    3030  [View("VRP InstanceProvider View")]
    31   [Content(typeof(VRPInstanceProvider<>), IsDefaultView = true)]
    32   public partial class VRPInstanceProviderView<T> : ProblemInstanceProviderViewGeneric<T> where T : class, IVRPData {
     31  [Content(typeof(IProblemInstanceConsumer<IVRPData>), IsDefaultView = true)]
     32  public partial class VRPInstanceProviderView<T> : ProblemInstanceConsumerViewGeneric<T> where T : class, IVRPData {
    3333
    34     public new VRPInstanceProvider<T> Content {
    35       get { return (VRPInstanceProvider<T>)base.Content; }
     34    public new IProblemInstanceConsumer<T> Content {
     35      get { return (IProblemInstanceConsumer<T>)base.Content; }
    3636      set { base.Content = value; }
    3737    }
     
    4242
    4343    protected override void importButton_Click(object sender, EventArgs e) {
    44       using (var dialog = new VRPImportDialog(Content.Name)) {
    45         if (dialog.ShowDialog() == DialogResult.OK) {
    46           var instance = Content.LoadData(dialog.VRPFileName, dialog.TourFileName);
    47           try {
    48             GenericConsumer.Load(instance as T);
    49           }
    50           catch (Exception ex) {
    51             MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(openFileDialog.FileName), Environment.NewLine + ex.Message), "Cannot load instance");
     44      IVRPInstanceProvider provider = SelectedProvider as IVRPInstanceProvider;
     45      if (provider != null) {
     46        using (var dialog = new VRPImportDialog(SelectedProvider.Name)) {
     47          if (dialog.ShowDialog() == DialogResult.OK) {
     48            var instance = provider.LoadData(dialog.VRPFileName, dialog.TourFileName);
     49            try {
     50              GenericConsumer.Load(instance as T);
     51            }
     52            catch (Exception ex) {
     53              MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(openFileDialog.FileName), Environment.NewLine + ex.Message), "Cannot load instance");
     54            }
    5255          }
    5356        }
  • branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4

  • branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4/HeuristicLab.Problems.Instances.VehicleRouting-3.4.csproj

    r7903 r7958  
    134134    <Compile Include="GoldenFormat\GoldenParser.cs" />
    135135    <Compile Include="GoldenFormat\GoldenFormatInstanceProvider.cs" />
     136    <Compile Include="IVRPInstanceProvider.cs" />
    136137    <Compile Include="TaillardFormat\TaillardInstanceProvider.cs" />
    137138    <Compile Include="TaillardFormat\TaillardParser.cs" />
  • branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4/VRPInstanceProvider.cs

    r7881 r7958  
    2929
    3030namespace HeuristicLab.Problems.Instances.VehicleRouting {
    31   public abstract class VRPInstanceProvider<T> : ProblemInstanceProvider<T> where T : IVRPData {
     31  public abstract class VRPInstanceProvider<T> : ProblemInstanceProvider<T>, IVRPInstanceProvider where T : IVRPData {
    3232    protected abstract string FileName { get; }
    3333
     
    110110    }
    111111
    112     public T LoadData(string vrpFile, string tourFile) {
     112    public IVRPData LoadData(string vrpFile, string tourFile) {
    113113      var data = LoadData(vrpFile);
    114114      if (!String.IsNullOrEmpty(tourFile)) {
  • branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4

  • branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/HeuristicLab.Problems.VehicleRouting.Views-3.4.csproj

    r7884 r7958  
    4040    <DebugType>full</DebugType>
    4141    <Optimize>false</Optimize>
    42     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     42    <OutputPath>..\..\bin\</OutputPath>
    4343    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4444    <ErrorReport>prompt</ErrorReport>
     
    4949    <DebugType>pdbonly</DebugType>
    5050    <Optimize>true</Optimize>
    51     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     51    <OutputPath>..\..\bin\</OutputPath>
    5252    <DefineConstants>TRACE</DefineConstants>
    5353    <ErrorReport>prompt</ErrorReport>
    5454    <WarningLevel>4</WarningLevel>
    55     <DocumentationFile>bin\Release\HeuristicLab.Problems.VehicleRouting.Views-3.4.xml</DocumentationFile>
     55    <DocumentationFile>
     56    </DocumentationFile>
    5657    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
    5758  </PropertyGroup>
    5859  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    5960    <DebugSymbols>true</DebugSymbols>
    60     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     61    <OutputPath>..\..\bin\</OutputPath>
    6162    <DefineConstants>DEBUG;TRACE</DefineConstants>
    6263    <DebugType>full</DebugType>
     
    6667  </PropertyGroup>
    6768  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    68     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     69    <OutputPath>..\..\bin\</OutputPath>
    6970    <DefineConstants>TRACE</DefineConstants>
    7071    <DocumentationFile>bin\x86\Release\HeuristicLab.Problems.VehicleRouting.Views-3.4.xml</DocumentationFile>
     
    7778  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    7879    <DebugSymbols>true</DebugSymbols>
    79     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     80    <OutputPath>..\..\bin\</OutputPath>
    8081    <DefineConstants>DEBUG;TRACE</DefineConstants>
    8182    <DebugType>full</DebugType>
     
    8586  </PropertyGroup>
    8687  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    87     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     88    <OutputPath>..\..\bin\</OutputPath>
    8889    <DefineConstants>TRACE</DefineConstants>
    8990    <DocumentationFile>bin\x64\Release\HeuristicLab.Problems.VehicleRouting.Views-3.4.xml</DocumentationFile>
  • branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/Plugin.cs.frame

    r7905 r7958  
    3131  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3232  [PluginDependency("HeuristicLab.Core", "3.3")]
     33  [PluginDependency("HeuristicLab.Data", "3.3")]
    3334  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
    3435  [PluginDependency("HeuristicLab.MainForm", "3.3")]
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4

  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs

    r7859 r7958  
    2121
    2222using System.Linq;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    2829using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2930using HeuristicLab.Problems.VehicleRouting.Interfaces;
     31using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    3032using HeuristicLab.Problems.VehicleRouting.Variants;
    31 using HeuristicLab.Common;
    32 using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    3333
    3434namespace HeuristicLab.Problems.VehicleRouting {
     
    8282    public BestVRPSolutionAnalyzer()
    8383      : base() {
    84         Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The problem instance."));
    85         Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("VRPTours", "The VRP tours which should be evaluated."));
     84      Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The problem instance."));
     85      Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("VRPTours", "The VRP tours which should be evaluated."));
    8686
    87         Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this VRP instance."));
    88         Parameters.Add(new LookupParameter<VRPSolution>("BestKnownSolution", "The best known solution of this VRP instance."));
     87      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this VRP instance."));
     88      Parameters.Add(new LookupParameter<VRPSolution>("BestKnownSolution", "The best known solution of this VRP instance."));
    8989
    90         Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the VRP solutions which should be analyzed."));
    91         Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Distance", "The distances of the VRP solutions which should be analyzed."));
    92         Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("VehiclesUtilized", "The utilized vehicles of the VRP solutions which should be analyzed."));
     90      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the VRP solutions which should be analyzed."));
     91      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Distance", "The distances of the VRP solutions which should be analyzed."));
     92      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("VehiclesUtilized", "The utilized vehicles of the VRP solutions which should be analyzed."));
    9393
    94         Parameters.Add(new LookupParameter<VRPSolution>("BestSolution", "The best VRP solution."));
    95         Parameters.Add(new LookupParameter<VRPSolution>("BestValidSolution", "The best valid VRP solution."));
    96         Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored."));
     94      Parameters.Add(new LookupParameter<VRPSolution>("BestSolution", "The best VRP solution."));
     95      Parameters.Add(new LookupParameter<VRPSolution>("BestValidSolution", "The best valid VRP solution."));
     96      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored."));
    9797    }
    9898
     
    106106
    107107    [StorableHook(HookType.AfterDeserialization)]
    108     private void AfterDeserializationHook() {
     108    private void AfterDeserialization() {
    109109      #region Backwards Compatibility
    110110      if (!Parameters.ContainsKey("BestKnownQuality")) {
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj

    r7884 r7958  
    4040    <DebugType>full</DebugType>
    4141    <Optimize>false</Optimize>
    42     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     42    <OutputPath>..\..\bin\</OutputPath>
    4343    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4444    <ErrorReport>prompt</ErrorReport>
     
    5151    <DebugType>pdbonly</DebugType>
    5252    <Optimize>true</Optimize>
    53     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     53    <OutputPath>..\..\bin\</OutputPath>
    5454    <DefineConstants>TRACE</DefineConstants>
    5555    <ErrorReport>prompt</ErrorReport>
    5656    <WarningLevel>4</WarningLevel>
    57     <DocumentationFile>bin\Release\HeuristicLab.Problems.VehicleRouting-3.4.xml</DocumentationFile>
     57    <DocumentationFile>
     58    </DocumentationFile>
    5859    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    5960    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     
    6162  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    6263    <DebugSymbols>true</DebugSymbols>
    63     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     64    <OutputPath>..\..\bin\</OutputPath>
    6465    <DefineConstants>DEBUG;TRACE</DefineConstants>
    6566    <DebugType>full</DebugType>
     
    6970  </PropertyGroup>
    7071  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    71     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     72    <OutputPath>..\..\bin\</OutputPath>
    7273    <DefineConstants>TRACE</DefineConstants>
    7374    <DocumentationFile>bin\x86\Release\HeuristicLab.Routing.TSP-3.3.xml</DocumentationFile>
     
    8081  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    8182    <DebugSymbols>true</DebugSymbols>
    82     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     83    <OutputPath>..\..\bin\</OutputPath>
    8384    <DefineConstants>DEBUG;TRACE</DefineConstants>
    8485    <DebugType>full</DebugType>
     
    8889  </PropertyGroup>
    8990  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    90     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     91    <OutputPath>..\..\bin\</OutputPath>
    9192    <DefineConstants>TRACE</DefineConstants>
    9293    <DocumentationFile>bin\x64\Release\HeuristicLab.Routing.TSP-3.3.XML</DocumentationFile>
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPProblemInstance.cs

    r7864 r7958  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2826using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    3027using HeuristicLab.Data;
    3128using HeuristicLab.Optimization;
     29using HeuristicLab.Parameters;
     30using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3231using HeuristicLab.PluginInfrastructure;
     32using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3333using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Common;
    3534
    3635namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3736  [Item("MDCVRPProblemInstance", "Represents a multi depot CVRP instance.")]
    3837  [StorableClass]
    39   public class MDCVRPProblemInstance: MultiDepotVRPProblemInstance, IHeterogenousCapacitatedProblemInstance {
     38  public class MDCVRPProblemInstance : MultiDepotVRPProblemInstance, IHeterogenousCapacitatedProblemInstance {
    4039    protected IValueParameter<DoubleArray> CapacityParameter {
    4140      get { return (IValueParameter<DoubleArray>)Parameters["Capacity"]; }
     
    6665
    6766    protected override IEnumerable<IOperator> GetOperators() {
    68         return base.GetOperators()
    69           .Where(o => o is IHeterogenousCapacitatedOperator).Cast<IOperator>();
     67      return base.GetOperators()
     68        .Where(o => o is IHeterogenousCapacitatedOperator).Cast<IOperator>();
    7069    }
    7170
     
    8180      }
    8281    }
    83    
     82
    8483    [StorableConstructor]
    8584    protected MDCVRPProblemInstance(bool deserializing) : base(deserializing) { }
     
    9998    protected MDCVRPProblemInstance(MDCVRPProblemInstance original, Cloner cloner)
    10099      : base(original, cloner) {
    101         AttachEventHandlers();
     100      AttachEventHandlers();
    102101    }
    103102
    104103    [StorableHook(HookType.AfterDeserialization)]
    105     private void AfterDeserializationHook() {
     104    private void AfterDeserialization() {
    106105      AttachEventHandlers();
    107106    }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs

    r7864 r7958  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2826using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    3027using HeuristicLab.Data;
    3128using HeuristicLab.Optimization;
     29using HeuristicLab.Parameters;
     30using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3231using HeuristicLab.PluginInfrastructure;
     32using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3333using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Common;
    3534
    3635namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3736  [Item("MDCVRPPDTWProblemInstance", "Represents a multi depot CVRPPDTW instance.")]
    3837  [StorableClass]
    39   public class MDCVRPPDTWProblemInstance: MDCVRPTWProblemInstance, IPickupAndDeliveryProblemInstance {
     38  public class MDCVRPPDTWProblemInstance : MDCVRPTWProblemInstance, IPickupAndDeliveryProblemInstance {
    4039    protected IValueParameter<IntArray> PickupDeliveryLocationParameter {
    4140      get { return (IValueParameter<IntArray>)Parameters["PickupDeliveryLocation"]; }
     
    4443      get { return (IValueParameter<DoubleValue>)Parameters["EvalPickupViolationPenalty"]; }
    4544    }
    46    
     45
    4746    public IntArray PickupDeliveryLocation {
    4847      get { return PickupDeliveryLocationParameter.Value; }
     
    6665
    6766    protected override IEnumerable<IOperator> GetOperators() {
    68       return 
     67      return
    6968        ApplicationManager.Manager.GetInstances<IPickupAndDeliveryOperator>()
    7069        .Where(o => !(o is IAnalyzer))
     
    7776        .Cast<IOperator>().Union(base.GetAnalyzers());
    7877    }
    79    
     78
    8079    protected override IVRPEvaluator Evaluator {
    8180      get {
     
    8786      return PickupDeliveryLocation[city - 1];
    8887    }
    89    
     88
    9089    [StorableConstructor]
    9190    protected MDCVRPPDTWProblemInstance(bool deserializing) : base(deserializing) { }
     
    106105    protected MDCVRPPDTWProblemInstance(MDCVRPPDTWProblemInstance original, Cloner cloner)
    107106      : base(original, cloner) {
    108         AttachEventHandlers();
     107      AttachEventHandlers();
    109108    }
    110109
    111110    [StorableHook(HookType.AfterDeserialization)]
    112     private void AfterDeserializationHook() {
     111    private void AfterDeserialization() {
    113112      AttachEventHandlers();
    114113    }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWProblemInstance.cs

    r7864 r7958  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2826using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    3027using HeuristicLab.Data;
    3128using HeuristicLab.Optimization;
     29using HeuristicLab.Parameters;
     30using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3231using HeuristicLab.PluginInfrastructure;
     32using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3333using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Common;
    3534
    3635namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3736  [Item("MDCVRPTWProblemInstance", "Represents a multi depot CVRPTW instance.")]
    3837  [StorableClass]
    39   public class MDCVRPTWProblemInstance: MDCVRPProblemInstance, ITimeWindowedProblemInstance {
     38  public class MDCVRPTWProblemInstance : MDCVRPProblemInstance, ITimeWindowedProblemInstance {
    4039    protected IValueParameter<DoubleArray> ReadyTimeParameter {
    4140      get { return (IValueParameter<DoubleArray>)Parameters["ReadyTime"]; }
     
    9796        .Cast<IOperator>().Union(base.GetAnalyzers());
    9897    }
    99    
     98
    10099    protected override IVRPEvaluator Evaluator {
    101100      get {
     
    103102      }
    104103    }
    105    
     104
    106105    [StorableConstructor]
    107106    protected MDCVRPTWProblemInstance(bool deserializing) : base(deserializing) { }
     
    125124    protected MDCVRPTWProblemInstance(MDCVRPTWProblemInstance original, Cloner cloner)
    126125      : base(original, cloner) {
    127         AttachEventHandlers();
     126      AttachEventHandlers();
    128127    }
    129128
    130129    [StorableHook(HookType.AfterDeserialization)]
    131     private void AfterDeserializationHook() {
     130    private void AfterDeserialization() {
    132131      AttachEventHandlers();
    133132    }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPProblemInstance.cs

    r7864 r7958  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2826using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    3027using HeuristicLab.Data;
    3128using HeuristicLab.Optimization;
     29using HeuristicLab.Parameters;
     30using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3231using HeuristicLab.PluginInfrastructure;
     32using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3333using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Common;
    3534
    3635namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3736  [Item("CVRPProblemInstance", "Represents a single depot CVRP instance.")]
    3837  [StorableClass]
    39   public class CVRPProblemInstance: SingleDepotVRPProblemInstance, IHomogenousCapacitatedProblemInstance {
     38  public class CVRPProblemInstance : SingleDepotVRPProblemInstance, IHomogenousCapacitatedProblemInstance {
    4039    protected IValueParameter<DoubleValue> CapacityParameter {
    4140      get { return (IValueParameter<DoubleValue>)Parameters["Capacity"]; }
     
    6059          return currentOverloadPenalty;
    6160        else
    62           return OverloadPenaltyParameter.Value; }
     61          return OverloadPenaltyParameter.Value;
     62      }
    6363      set { CurrentOverloadPenaltyParameter.Value = value; }
    6464    }
    6565
    6666    protected override IEnumerable<IOperator> GetOperators() {
    67         return base.GetOperators()
    68           .Where(o => o is IHomogenousCapacitatedOperator).Cast<IOperator>();
     67      return base.GetOperators()
     68        .Where(o => o is IHomogenousCapacitatedOperator).Cast<IOperator>();
    6969    }
    7070
     
    8080      }
    8181    }
    82    
     82
    8383    [StorableConstructor]
    8484    protected CVRPProblemInstance(bool deserializing) : base(deserializing) { }
     
    9898    protected CVRPProblemInstance(CVRPProblemInstance original, Cloner cloner)
    9999      : base(original, cloner) {
    100         AttachEventHandlers();
     100      AttachEventHandlers();
    101101    }
    102102
    103103    [StorableHook(HookType.AfterDeserialization)]
    104     private void AfterDeserializationHook() {
     104    private void AfterDeserialization() {
    105105      AttachEventHandlers();
    106106    }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWProblemInstance.cs

    r7864 r7958  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2826using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    3027using HeuristicLab.Data;
    3128using HeuristicLab.Optimization;
     29using HeuristicLab.Parameters;
     30using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3231using HeuristicLab.PluginInfrastructure;
     32using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3333using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Common;
    3534
    3635namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3736  [Item("CVRPPDTWProblemInstance", "Represents a single depot CVRPPDTW instance.")]
    3837  [StorableClass]
    39   public class CVRPPDTWProblemInstance: CVRPTWProblemInstance, IPickupAndDeliveryProblemInstance {
     38  public class CVRPPDTWProblemInstance : CVRPTWProblemInstance, IPickupAndDeliveryProblemInstance {
    4039    protected IValueParameter<IntArray> PickupDeliveryLocationParameter {
    4140      get { return (IValueParameter<IntArray>)Parameters["PickupDeliveryLocation"]; }
     
    4443      get { return (IValueParameter<DoubleValue>)Parameters["EvalPickupViolationPenalty"]; }
    4544    }
    46    
     45
    4746    public IntArray PickupDeliveryLocation {
    4847      get { return PickupDeliveryLocationParameter.Value; }
     
    6665
    6766    protected override IEnumerable<IOperator> GetOperators() {
    68       return 
     67      return
    6968        ApplicationManager.Manager.GetInstances<IPickupAndDeliveryOperator>()
    7069        .Where(o => !(o is IAnalyzer))
     
    7776        .Cast<IOperator>().Union(base.GetAnalyzers());
    7877    }
    79    
     78
    8079    protected override IVRPEvaluator Evaluator {
    8180      get {
     
    8786      return PickupDeliveryLocation[city];
    8887    }
    89    
     88
    9089    [StorableConstructor]
    9190    protected CVRPPDTWProblemInstance(bool deserializing) : base(deserializing) { }
     
    106105    protected CVRPPDTWProblemInstance(CVRPPDTWProblemInstance original, Cloner cloner)
    107106      : base(original, cloner) {
    108         AttachEventHandlers();
     107      AttachEventHandlers();
    109108    }
    110109
    111110    [StorableHook(HookType.AfterDeserialization)]
    112     private void AfterDeserializationHook() {
     111    private void AfterDeserialization() {
    113112      AttachEventHandlers();
    114113    }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs

    r7864 r7958  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2826using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    3027using HeuristicLab.Data;
    3128using HeuristicLab.Optimization;
     29using HeuristicLab.Parameters;
     30using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3231using HeuristicLab.PluginInfrastructure;
     32using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3333using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Common;
    3534
    3635namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3736  [Item("CVRPTWProblemInstance", "Represents a single depot CVRPTW instance.")]
    3837  [StorableClass]
    39   public class CVRPTWProblemInstance: CVRPProblemInstance, ITimeWindowedProblemInstance {
     38  public class CVRPTWProblemInstance : CVRPProblemInstance, ITimeWindowedProblemInstance {
    4039    protected IValueParameter<DoubleArray> ReadyTimeParameter {
    4140      get { return (IValueParameter<DoubleArray>)Parameters["ReadyTime"]; }
     
    9796        .Cast<IOperator>().Union(base.GetAnalyzers());
    9897    }
    99    
     98
    10099    protected override IVRPEvaluator Evaluator {
    101100      get {
     
    103102      }
    104103    }
    105    
     104
    106105    [StorableConstructor]
    107106    protected CVRPTWProblemInstance(bool deserializing) : base(deserializing) { }
     
    125124    protected CVRPTWProblemInstance(CVRPTWProblemInstance original, Cloner cloner)
    126125      : base(original, cloner) {
    127         AttachEventHandlers();
     126      AttachEventHandlers();
    128127    }
    129128
    130129    [StorableHook(HookType.AfterDeserialization)]
    131     private void AfterDeserializationHook() {
     130    private void AfterDeserialization() {
    132131      AttachEventHandlers();
    133132    }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs

    r7852 r7958  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using System.Text;
     25using HeuristicLab.Common;
     26using HeuristicLab.Core;
     27using HeuristicLab.Data;
     28using HeuristicLab.Parameters;
     29using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2631using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Optimization;
    32 using HeuristicLab.PluginInfrastructure;
    33 using HeuristicLab.Common;
    34 using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3532
    3633namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    7269      }
    7370    }
    74    
     71
    7572    protected ValueParameter<DoubleMatrix> CoordinatesParameter {
    7673      get { return (ValueParameter<DoubleMatrix>)Parameters["Coordinates"]; }
     
    174171
    175172    public IVRPEvaluator SolutionEvaluator {
    176       get {       
     173      get {
    177174        return evaluator;
    178175      }
     
    187184      if (distanceMatrix != null)
    188185        distance = distanceMatrix[start, end];
    189       else 
     186      else
    190187        distance = CalculateDistance(start, end);
    191188
     
    199196      startDistance = GetDistance(start, customer, solution);
    200197      endDistance = GetDistance(customer, end, solution);
    201      
     198
    202199      double newDistance = startDistance + endDistance;
    203200
     
    244241    protected abstract IVRPEvaluator Evaluator { get; }
    245242    protected abstract IVRPCreator Creator { get; }
    246    
     243
    247244    [StorableConstructor]
    248245    protected VRPProblemInstance(bool deserializing) : base(deserializing) { }
     
    265262    protected VRPProblemInstance(VRPProblemInstance original, Cloner cloner)
    266263      : base(original, cloner) {
    267       evaluator = Evaluator; 
     264      evaluator = Evaluator;
    268265      AttachEventHandlers();
    269266    }
    270267
    271268    [StorableHook(HookType.AfterDeserialization)]
    272     private void AfterDeserializationHook() {
     269    private void AfterDeserialization() {
    273270      evaluator = Evaluator;
    274271      AttachEventHandlers();
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs

    r7907 r7958  
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Data;
    29 using HeuristicLab.Encodings.PermutationEncoding;
    3029using HeuristicLab.Optimization;
    3130using HeuristicLab.Parameters;
    3231using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3332using HeuristicLab.PluginInfrastructure;
     33using HeuristicLab.Problems.Instances;
    3434using HeuristicLab.Problems.VehicleRouting.Interfaces;
     35using HeuristicLab.Problems.VehicleRouting.Interpreters;
    3536using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    3637using HeuristicLab.Problems.VehicleRouting.Variants;
    37 using HeuristicLab.Problems.Instances;
    38 using System.Reflection;
    39 using HeuristicLab.Problems.VehicleRouting.Interpreters;
    4038
    4139namespace HeuristicLab.Problems.VehicleRouting {
     
    112110
    113111    [Storable]
    114     private List<IOperator> operators; 
     112    private List<IOperator> operators;
    115113
    116114    public IEnumerable<IOperator> Operators {
     
    173171      EventHandler handler = Reset;
    174172      if (handler != null) handler(this, EventArgs.Empty);
    175     } 
     173    }
    176174    #endregion
    177175
    178176    #region Helpers
    179177    [StorableHook(HookType.AfterDeserialization)]
    180     private void AfterDeserializationHook() {
     178    private void AfterDeserialization() {
    181179      AttachEventHandlers();
    182180      AttachProblemInstanceEventHandlers();
     
    204202
    205203        ProblemInstance.EvaluationChanged += new EventHandler(ProblemInstance_EvaluationChanged);
    206       }     
     204      }
    207205    }
    208206
     
    248246    private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {
    249247      ParameterizeSolutionCreator();
    250      
     248
    251249      OnSolutionCreatorChanged();
    252250    }
     
    369367      } else {
    370368        throw new Exception("Cannot find an interpreter for " + data.GetType());
    371       }   
     369      }
    372370    }
    373371  }
Note: See TracChangeset for help on using the changeset viewer.