Changeset 7958 for branches/VRP
- Timestamp:
- 06/05/12 08:34:36 (12 years ago)
- Location:
- branches/VRP
- Files:
-
- 20 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4
-
Property
svn:mergeinfo
set to
/trunk/sources/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4 merged eligible
-
Property
svn:mergeinfo
set to
-
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4/HeuristicLab.Problems.Instances.VehicleRouting.Views-3.4.csproj
r7903 r7958 18 18 <DebugType>full</DebugType> 19 19 <Optimize>false</Optimize> 20 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>20 <OutputPath>..\..\bin\</OutputPath> 21 21 <DefineConstants>DEBUG;TRACE</DefineConstants> 22 22 <ErrorReport>prompt</ErrorReport> -
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4/VRPInstanceProviderView.cs
r7882 r7958 21 21 22 22 using System; 23 using System.IO; 23 24 using System.Windows.Forms; 24 25 using HeuristicLab.MainForm; 25 26 using HeuristicLab.MainForm.WindowsForms; 26 27 using HeuristicLab.Problems.Instances.Views; 27 using System.IO;28 28 29 29 namespace HeuristicLab.Problems.Instances.VehicleRouting.Views { 30 30 [View("VRP InstanceProvider View")] 31 [Content(typeof( VRPInstanceProvider<>), IsDefaultView = true)]32 public partial class VRPInstanceProviderView<T> : ProblemInstance ProviderViewGeneric<T> where T : class, IVRPData{31 [Content(typeof(IProblemInstanceConsumer<IVRPData>), IsDefaultView = true)] 32 public partial class VRPInstanceProviderView<T> : ProblemInstanceConsumerViewGeneric<T> where T : class, IVRPData { 33 33 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; } 36 36 set { base.Content = value; } 37 37 } … … 42 42 43 43 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 } 52 55 } 53 56 } -
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4
-
Property
svn:mergeinfo
set to
/trunk/sources/HeuristicLab.Problems.Instances.VehicleRouting/3.4 merged eligible
-
Property
svn:mergeinfo
set to
-
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4/HeuristicLab.Problems.Instances.VehicleRouting-3.4.csproj
r7903 r7958 134 134 <Compile Include="GoldenFormat\GoldenParser.cs" /> 135 135 <Compile Include="GoldenFormat\GoldenFormatInstanceProvider.cs" /> 136 <Compile Include="IVRPInstanceProvider.cs" /> 136 137 <Compile Include="TaillardFormat\TaillardInstanceProvider.cs" /> 137 138 <Compile Include="TaillardFormat\TaillardParser.cs" /> -
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4/VRPInstanceProvider.cs
r7881 r7958 29 29 30 30 namespace 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 { 32 32 protected abstract string FileName { get; } 33 33 … … 110 110 } 111 111 112 public TLoadData(string vrpFile, string tourFile) {112 public IVRPData LoadData(string vrpFile, string tourFile) { 113 113 var data = LoadData(vrpFile); 114 114 if (!String.IsNullOrEmpty(tourFile)) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.4 merged: 7906,7923
- Property svn:mergeinfo changed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/HeuristicLab.Problems.VehicleRouting.Views-3.4.csproj
r7884 r7958 40 40 <DebugType>full</DebugType> 41 41 <Optimize>false</Optimize> 42 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>42 <OutputPath>..\..\bin\</OutputPath> 43 43 <DefineConstants>DEBUG;TRACE</DefineConstants> 44 44 <ErrorReport>prompt</ErrorReport> … … 49 49 <DebugType>pdbonly</DebugType> 50 50 <Optimize>true</Optimize> 51 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>51 <OutputPath>..\..\bin\</OutputPath> 52 52 <DefineConstants>TRACE</DefineConstants> 53 53 <ErrorReport>prompt</ErrorReport> 54 54 <WarningLevel>4</WarningLevel> 55 <DocumentationFile>bin\Release\HeuristicLab.Problems.VehicleRouting.Views-3.4.xml</DocumentationFile> 55 <DocumentationFile> 56 </DocumentationFile> 56 57 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 57 58 </PropertyGroup> 58 59 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 59 60 <DebugSymbols>true</DebugSymbols> 60 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>61 <OutputPath>..\..\bin\</OutputPath> 61 62 <DefineConstants>DEBUG;TRACE</DefineConstants> 62 63 <DebugType>full</DebugType> … … 66 67 </PropertyGroup> 67 68 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 68 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>69 <OutputPath>..\..\bin\</OutputPath> 69 70 <DefineConstants>TRACE</DefineConstants> 70 71 <DocumentationFile>bin\x86\Release\HeuristicLab.Problems.VehicleRouting.Views-3.4.xml</DocumentationFile> … … 77 78 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> 78 79 <DebugSymbols>true</DebugSymbols> 79 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>80 <OutputPath>..\..\bin\</OutputPath> 80 81 <DefineConstants>DEBUG;TRACE</DefineConstants> 81 82 <DebugType>full</DebugType> … … 85 86 </PropertyGroup> 86 87 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> 87 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>88 <OutputPath>..\..\bin\</OutputPath> 88 89 <DefineConstants>TRACE</DefineConstants> 89 90 <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 31 31 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 32 32 [PluginDependency("HeuristicLab.Core", "3.3")] 33 [PluginDependency("HeuristicLab.Data", "3.3")] 33 34 [PluginDependency("HeuristicLab.Core.Views", "3.3")] 34 35 [PluginDependency("HeuristicLab.MainForm", "3.3")] -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4 merged: 7923,7934
- Property svn:mergeinfo changed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs
r7859 r7958 21 21 22 22 using System.Linq; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 28 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 30 32 using HeuristicLab.Problems.VehicleRouting.Variants; 31 using HeuristicLab.Common;32 using HeuristicLab.Problems.VehicleRouting.ProblemInstances;33 33 34 34 namespace HeuristicLab.Problems.VehicleRouting { … … 82 82 public BestVRPSolutionAnalyzer() 83 83 : base() { 84 85 84 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The problem instance.")); 85 Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("VRPTours", "The VRP tours which should be evaluated.")); 86 86 87 88 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.")); 89 89 90 91 92 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.")); 93 93 94 95 96 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.")); 97 97 } 98 98 … … 106 106 107 107 [StorableHook(HookType.AfterDeserialization)] 108 private void AfterDeserialization Hook() {108 private void AfterDeserialization() { 109 109 #region Backwards Compatibility 110 110 if (!Parameters.ContainsKey("BestKnownQuality")) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj
r7884 r7958 40 40 <DebugType>full</DebugType> 41 41 <Optimize>false</Optimize> 42 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>42 <OutputPath>..\..\bin\</OutputPath> 43 43 <DefineConstants>DEBUG;TRACE</DefineConstants> 44 44 <ErrorReport>prompt</ErrorReport> … … 51 51 <DebugType>pdbonly</DebugType> 52 52 <Optimize>true</Optimize> 53 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>53 <OutputPath>..\..\bin\</OutputPath> 54 54 <DefineConstants>TRACE</DefineConstants> 55 55 <ErrorReport>prompt</ErrorReport> 56 56 <WarningLevel>4</WarningLevel> 57 <DocumentationFile>bin\Release\HeuristicLab.Problems.VehicleRouting-3.4.xml</DocumentationFile> 57 <DocumentationFile> 58 </DocumentationFile> 58 59 <TreatWarningsAsErrors>false</TreatWarningsAsErrors> 59 60 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> … … 61 62 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 62 63 <DebugSymbols>true</DebugSymbols> 63 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>64 <OutputPath>..\..\bin\</OutputPath> 64 65 <DefineConstants>DEBUG;TRACE</DefineConstants> 65 66 <DebugType>full</DebugType> … … 69 70 </PropertyGroup> 70 71 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 71 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>72 <OutputPath>..\..\bin\</OutputPath> 72 73 <DefineConstants>TRACE</DefineConstants> 73 74 <DocumentationFile>bin\x86\Release\HeuristicLab.Routing.TSP-3.3.xml</DocumentationFile> … … 80 81 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> 81 82 <DebugSymbols>true</DebugSymbols> 82 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>83 <OutputPath>..\..\bin\</OutputPath> 83 84 <DefineConstants>DEBUG;TRACE</DefineConstants> 84 85 <DebugType>full</DebugType> … … 88 89 </PropertyGroup> 89 90 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> 90 <OutputPath>..\..\ ..\..\trunk\sources\bin\</OutputPath>91 <OutputPath>..\..\bin\</OutputPath> 91 92 <DefineConstants>TRACE</DefineConstants> 92 93 <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 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("MDCVRPProblemInstance", "Represents a multi depot CVRP instance.")] 38 37 [StorableClass] 39 public class MDCVRPProblemInstance : MultiDepotVRPProblemInstance, IHeterogenousCapacitatedProblemInstance {38 public class MDCVRPProblemInstance : MultiDepotVRPProblemInstance, IHeterogenousCapacitatedProblemInstance { 40 39 protected IValueParameter<DoubleArray> CapacityParameter { 41 40 get { return (IValueParameter<DoubleArray>)Parameters["Capacity"]; } … … 66 65 67 66 protected override IEnumerable<IOperator> GetOperators() { 68 69 67 return base.GetOperators() 68 .Where(o => o is IHeterogenousCapacitatedOperator).Cast<IOperator>(); 70 69 } 71 70 … … 81 80 } 82 81 } 83 82 84 83 [StorableConstructor] 85 84 protected MDCVRPProblemInstance(bool deserializing) : base(deserializing) { } … … 99 98 protected MDCVRPProblemInstance(MDCVRPProblemInstance original, Cloner cloner) 100 99 : base(original, cloner) { 101 100 AttachEventHandlers(); 102 101 } 103 102 104 103 [StorableHook(HookType.AfterDeserialization)] 105 private void AfterDeserialization Hook() {104 private void AfterDeserialization() { 106 105 AttachEventHandlers(); 107 106 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs
r7864 r7958 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("MDCVRPPDTWProblemInstance", "Represents a multi depot CVRPPDTW instance.")] 38 37 [StorableClass] 39 public class MDCVRPPDTWProblemInstance : MDCVRPTWProblemInstance, IPickupAndDeliveryProblemInstance {38 public class MDCVRPPDTWProblemInstance : MDCVRPTWProblemInstance, IPickupAndDeliveryProblemInstance { 40 39 protected IValueParameter<IntArray> PickupDeliveryLocationParameter { 41 40 get { return (IValueParameter<IntArray>)Parameters["PickupDeliveryLocation"]; } … … 44 43 get { return (IValueParameter<DoubleValue>)Parameters["EvalPickupViolationPenalty"]; } 45 44 } 46 45 47 46 public IntArray PickupDeliveryLocation { 48 47 get { return PickupDeliveryLocationParameter.Value; } … … 66 65 67 66 protected override IEnumerable<IOperator> GetOperators() { 68 return 67 return 69 68 ApplicationManager.Manager.GetInstances<IPickupAndDeliveryOperator>() 70 69 .Where(o => !(o is IAnalyzer)) … … 77 76 .Cast<IOperator>().Union(base.GetAnalyzers()); 78 77 } 79 78 80 79 protected override IVRPEvaluator Evaluator { 81 80 get { … … 87 86 return PickupDeliveryLocation[city - 1]; 88 87 } 89 88 90 89 [StorableConstructor] 91 90 protected MDCVRPPDTWProblemInstance(bool deserializing) : base(deserializing) { } … … 106 105 protected MDCVRPPDTWProblemInstance(MDCVRPPDTWProblemInstance original, Cloner cloner) 107 106 : base(original, cloner) { 108 107 AttachEventHandlers(); 109 108 } 110 109 111 110 [StorableHook(HookType.AfterDeserialization)] 112 private void AfterDeserialization Hook() {111 private void AfterDeserialization() { 113 112 AttachEventHandlers(); 114 113 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWProblemInstance.cs
r7864 r7958 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("MDCVRPTWProblemInstance", "Represents a multi depot CVRPTW instance.")] 38 37 [StorableClass] 39 public class MDCVRPTWProblemInstance : MDCVRPProblemInstance, ITimeWindowedProblemInstance {38 public class MDCVRPTWProblemInstance : MDCVRPProblemInstance, ITimeWindowedProblemInstance { 40 39 protected IValueParameter<DoubleArray> ReadyTimeParameter { 41 40 get { return (IValueParameter<DoubleArray>)Parameters["ReadyTime"]; } … … 97 96 .Cast<IOperator>().Union(base.GetAnalyzers()); 98 97 } 99 98 100 99 protected override IVRPEvaluator Evaluator { 101 100 get { … … 103 102 } 104 103 } 105 104 106 105 [StorableConstructor] 107 106 protected MDCVRPTWProblemInstance(bool deserializing) : base(deserializing) { } … … 125 124 protected MDCVRPTWProblemInstance(MDCVRPTWProblemInstance original, Cloner cloner) 126 125 : base(original, cloner) { 127 126 AttachEventHandlers(); 128 127 } 129 128 130 129 [StorableHook(HookType.AfterDeserialization)] 131 private void AfterDeserialization Hook() {130 private void AfterDeserialization() { 132 131 AttachEventHandlers(); 133 132 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPProblemInstance.cs
r7864 r7958 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("CVRPProblemInstance", "Represents a single depot CVRP instance.")] 38 37 [StorableClass] 39 public class CVRPProblemInstance : SingleDepotVRPProblemInstance, IHomogenousCapacitatedProblemInstance {38 public class CVRPProblemInstance : SingleDepotVRPProblemInstance, IHomogenousCapacitatedProblemInstance { 40 39 protected IValueParameter<DoubleValue> CapacityParameter { 41 40 get { return (IValueParameter<DoubleValue>)Parameters["Capacity"]; } … … 60 59 return currentOverloadPenalty; 61 60 else 62 return OverloadPenaltyParameter.Value; } 61 return OverloadPenaltyParameter.Value; 62 } 63 63 set { CurrentOverloadPenaltyParameter.Value = value; } 64 64 } 65 65 66 66 protected override IEnumerable<IOperator> GetOperators() { 67 68 67 return base.GetOperators() 68 .Where(o => o is IHomogenousCapacitatedOperator).Cast<IOperator>(); 69 69 } 70 70 … … 80 80 } 81 81 } 82 82 83 83 [StorableConstructor] 84 84 protected CVRPProblemInstance(bool deserializing) : base(deserializing) { } … … 98 98 protected CVRPProblemInstance(CVRPProblemInstance original, Cloner cloner) 99 99 : base(original, cloner) { 100 100 AttachEventHandlers(); 101 101 } 102 102 103 103 [StorableHook(HookType.AfterDeserialization)] 104 private void AfterDeserialization Hook() {104 private void AfterDeserialization() { 105 105 AttachEventHandlers(); 106 106 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWProblemInstance.cs
r7864 r7958 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("CVRPPDTWProblemInstance", "Represents a single depot CVRPPDTW instance.")] 38 37 [StorableClass] 39 public class CVRPPDTWProblemInstance : CVRPTWProblemInstance, IPickupAndDeliveryProblemInstance {38 public class CVRPPDTWProblemInstance : CVRPTWProblemInstance, IPickupAndDeliveryProblemInstance { 40 39 protected IValueParameter<IntArray> PickupDeliveryLocationParameter { 41 40 get { return (IValueParameter<IntArray>)Parameters["PickupDeliveryLocation"]; } … … 44 43 get { return (IValueParameter<DoubleValue>)Parameters["EvalPickupViolationPenalty"]; } 45 44 } 46 45 47 46 public IntArray PickupDeliveryLocation { 48 47 get { return PickupDeliveryLocationParameter.Value; } … … 66 65 67 66 protected override IEnumerable<IOperator> GetOperators() { 68 return 67 return 69 68 ApplicationManager.Manager.GetInstances<IPickupAndDeliveryOperator>() 70 69 .Where(o => !(o is IAnalyzer)) … … 77 76 .Cast<IOperator>().Union(base.GetAnalyzers()); 78 77 } 79 78 80 79 protected override IVRPEvaluator Evaluator { 81 80 get { … … 87 86 return PickupDeliveryLocation[city]; 88 87 } 89 88 90 89 [StorableConstructor] 91 90 protected CVRPPDTWProblemInstance(bool deserializing) : base(deserializing) { } … … 106 105 protected CVRPPDTWProblemInstance(CVRPPDTWProblemInstance original, Cloner cloner) 107 106 : base(original, cloner) { 108 107 AttachEventHandlers(); 109 108 } 110 109 111 110 [StorableHook(HookType.AfterDeserialization)] 112 private void AfterDeserialization Hook() {111 private void AfterDeserialization() { 113 112 AttachEventHandlers(); 114 113 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs
r7864 r7958 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("CVRPTWProblemInstance", "Represents a single depot CVRPTW instance.")] 38 37 [StorableClass] 39 public class CVRPTWProblemInstance : CVRPProblemInstance, ITimeWindowedProblemInstance {38 public class CVRPTWProblemInstance : CVRPProblemInstance, ITimeWindowedProblemInstance { 40 39 protected IValueParameter<DoubleArray> ReadyTimeParameter { 41 40 get { return (IValueParameter<DoubleArray>)Parameters["ReadyTime"]; } … … 97 96 .Cast<IOperator>().Union(base.GetAnalyzers()); 98 97 } 99 98 100 99 protected override IVRPEvaluator Evaluator { 101 100 get { … … 103 102 } 104 103 } 105 104 106 105 [StorableConstructor] 107 106 protected CVRPTWProblemInstance(bool deserializing) : base(deserializing) { } … … 125 124 protected CVRPTWProblemInstance(CVRPTWProblemInstance original, Cloner cloner) 126 125 : base(original, cloner) { 127 126 AttachEventHandlers(); 128 127 } 129 128 130 129 [StorableHook(HookType.AfterDeserialization)] 131 private void AfterDeserialization Hook() {130 private void AfterDeserialization() { 132 131 AttachEventHandlers(); 133 132 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r7852 r7958 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 25 using HeuristicLab.Common; 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 28 using HeuristicLab.Parameters; 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 26 31 using 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;35 32 36 33 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 72 69 } 73 70 } 74 71 75 72 protected ValueParameter<DoubleMatrix> CoordinatesParameter { 76 73 get { return (ValueParameter<DoubleMatrix>)Parameters["Coordinates"]; } … … 174 171 175 172 public IVRPEvaluator SolutionEvaluator { 176 get { 173 get { 177 174 return evaluator; 178 175 } … … 187 184 if (distanceMatrix != null) 188 185 distance = distanceMatrix[start, end]; 189 else 186 else 190 187 distance = CalculateDistance(start, end); 191 188 … … 199 196 startDistance = GetDistance(start, customer, solution); 200 197 endDistance = GetDistance(customer, end, solution); 201 198 202 199 double newDistance = startDistance + endDistance; 203 200 … … 244 241 protected abstract IVRPEvaluator Evaluator { get; } 245 242 protected abstract IVRPCreator Creator { get; } 246 243 247 244 [StorableConstructor] 248 245 protected VRPProblemInstance(bool deserializing) : base(deserializing) { } … … 265 262 protected VRPProblemInstance(VRPProblemInstance original, Cloner cloner) 266 263 : base(original, cloner) { 267 evaluator = Evaluator; 264 evaluator = Evaluator; 268 265 AttachEventHandlers(); 269 266 } 270 267 271 268 [StorableHook(HookType.AfterDeserialization)] 272 private void AfterDeserialization Hook() {269 private void AfterDeserialization() { 273 270 evaluator = Evaluator; 274 271 AttachEventHandlers(); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r7907 r7958 27 27 using HeuristicLab.Core; 28 28 using HeuristicLab.Data; 29 using HeuristicLab.Encodings.PermutationEncoding;30 29 using HeuristicLab.Optimization; 31 30 using HeuristicLab.Parameters; 32 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 33 32 using HeuristicLab.PluginInfrastructure; 33 using HeuristicLab.Problems.Instances; 34 34 using HeuristicLab.Problems.VehicleRouting.Interfaces; 35 using HeuristicLab.Problems.VehicleRouting.Interpreters; 35 36 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 36 37 using HeuristicLab.Problems.VehicleRouting.Variants; 37 using HeuristicLab.Problems.Instances;38 using System.Reflection;39 using HeuristicLab.Problems.VehicleRouting.Interpreters;40 38 41 39 namespace HeuristicLab.Problems.VehicleRouting { … … 112 110 113 111 [Storable] 114 private List<IOperator> operators; 112 private List<IOperator> operators; 115 113 116 114 public IEnumerable<IOperator> Operators { … … 173 171 EventHandler handler = Reset; 174 172 if (handler != null) handler(this, EventArgs.Empty); 175 } 173 } 176 174 #endregion 177 175 178 176 #region Helpers 179 177 [StorableHook(HookType.AfterDeserialization)] 180 private void AfterDeserialization Hook() {178 private void AfterDeserialization() { 181 179 AttachEventHandlers(); 182 180 AttachProblemInstanceEventHandlers(); … … 204 202 205 203 ProblemInstance.EvaluationChanged += new EventHandler(ProblemInstance_EvaluationChanged); 206 } 204 } 207 205 } 208 206 … … 248 246 private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) { 249 247 ParameterizeSolutionCreator(); 250 248 251 249 OnSolutionCreatorChanged(); 252 250 } … … 369 367 } else { 370 368 throw new Exception("Cannot find an interpreter for " + data.GetType()); 371 } 369 } 372 370 } 373 371 }
Note: See TracChangeset
for help on using the changeset viewer.