Changeset 11189
- Timestamp:
- 07/14/14 15:27:11 (10 years ago)
- Location:
- branches/HeuristicLab.Problems.Orienteering
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering.Views/3.3/HeuristicLab.Problems.Orienteering.Views-3.3.csproj
r11188 r11189 39 39 <Reference Include="System" /> 40 40 <Reference Include="System.Core" /> 41 <Reference Include="System.Data" /> 42 <Reference Include="System.Drawing" /> 43 <Reference Include="System.Windows.Forms" /> 44 <Reference Include="System.Xml" /> 41 45 </ItemGroup> 42 46 <ItemGroup> 47 <Compile Include="OrienteeringProblemView.cs"> 48 <SubType>UserControl</SubType> 49 </Compile> 50 <Compile Include="OrienteeringProblemView.Designer.cs"> 51 <DependentUpon>OrienteeringProblemView.cs</DependentUpon> 52 </Compile> 43 53 <Compile Include="Plugin.cs" /> 44 54 <Compile Include="Properties\AssemblyInfo.cs" /> … … 50 60 </ItemGroup> 51 61 <ItemGroup> 62 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 63 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project> 64 <Name>HeuristicLab.Common-3.3</Name> 65 </ProjectReference> 66 <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj"> 67 <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project> 68 <Name>HeuristicLab.Core.Views-3.3</Name> 69 </ProjectReference> 70 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 71 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project> 72 <Name>HeuristicLab.Core-3.3</Name> 73 </ProjectReference> 74 <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj"> 75 <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project> 76 <Name>HeuristicLab.MainForm.WindowsForms-3.3</Name> 77 </ProjectReference> 78 <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj"> 79 <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project> 80 <Name>HeuristicLab.MainForm-3.3</Name> 81 </ProjectReference> 82 <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj"> 83 <Project>{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}</Project> 84 <Name>HeuristicLab.Optimization.Views-3.3</Name> 85 </ProjectReference> 86 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 87 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> 88 <Name>HeuristicLab.Optimization-3.3</Name> 89 </ProjectReference> 52 90 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 53 91 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 54 92 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 93 </ProjectReference> 94 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> 95 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project> 96 <Name>HeuristicLab.Problems.Instances-3.3</Name> 97 </ProjectReference> 98 <ProjectReference Include="..\..\HeuristicLab.Problems.Orienteering\3.3\HeuristicLab.Problems.Orienteering-3.3.csproj"> 99 <Project>{D1EFA4CC-909F-41D5-9C1F-C3AF1957A372}</Project> 100 <Name>HeuristicLab.Problems.Orienteering-3.3</Name> 55 101 </ProjectReference> 56 102 </ItemGroup> -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/HeuristicLab.Problems.Orienteering-3.3.csproj
r11187 r11189 106 106 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 107 107 </ProjectReference> 108 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> 109 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project> 110 <Name>HeuristicLab.Problems.Instances-3.3</Name> 111 </ProjectReference> 108 112 <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj"> 109 113 <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project> -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs
r11187 r11189 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Problems.Instances; 30 31 31 32 namespace HeuristicLab.Problems.Orienteering { … … 36 37 public class OrienteeringProblem 37 38 : SingleObjectiveHeuristicOptimizationProblem<IOrienteeringEvaluator, IIntegerVectorCreator>, 38 IStorableContent {39 IStorableContent, IProblemInstanceConsumer<CVRPData> { 39 40 40 41 public string Filename { get; set; } … … 85 86 set { UseDistanceMatrixParameter.Value = value; } 86 87 } 88 public IntValue StartingPoint { 89 get { return StartingPointParameter.Value; } 90 set { StartingPointParameter.Value = value; } 91 } 92 public IntValue TerminusPoint { 93 get { return TerminusPointParameter.Value; } 94 set { TerminusPointParameter.Value = value; } 95 } 87 96 public DoubleValue MaximumDistance { 88 97 get { return MaximumDistanceParameter.Value; } … … 93 102 set { ScoresParameter.Value = value; } 94 103 } 104 public DoubleValue FixedPenalty { 105 get { return FixedPenaltyParameter.Value; } 106 set { FixedPenaltyParameter.Value = value; } 107 } 95 108 public IntegerVector BestKnownSolution { 96 109 get { return BestKnownSolutionParameter.Value; } … … 115 128 116 129 public OrienteeringProblem() 117 : base(new OrienteeringEvaluator(), new UniformRandomIntegerVectorCreator()) { 130 : base(new OrienteeringEvaluator(), new UniformRandomIntegerVectorCreator()) { // TODO: Greedy route creator for solution creator 118 131 Parameters.Add(new OptionalValueParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the points.")); 119 132 Parameters.Add(new OptionalValueParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the points.")); … … 197 210 // TODO 198 211 } 212 213 public void Load(CVRPData data) { 214 if (data.Coordinates == null && data.Distances == null) 215 throw new System.IO.InvalidDataException("The given instance specifies neither coordinates nor distances!"); 216 if (data.Coordinates != null && data.Coordinates.GetLength(1) != 2) 217 throw new System.IO.InvalidDataException("The coordinates of the given instance are not in the right format, there need to be one row for each customer and two columns for the x and y coordinates."); 218 219 Name = data.Name; 220 Description = data.Description; 221 222 Coordinates = data.Coordinates != null ? new DoubleMatrix(data.Coordinates) : null; 223 UseDistanceMatrix.Value = data.Distances != null; 224 DistanceMatrix = data.Distances != null ? new DistanceMatrix(data.Distances) : null; 225 StartingPoint = new IntValue(0);// Depot is interpreted as start and endpoint (default) 226 TerminusPoint = new IntValue(0); 227 228 MaximumDistance = new DoubleValue(data.Capacity); // capacity is interpreted as max distance 229 Scores = new DoubleArray(data.Demands); // demands are interpreted as scores 230 231 BestKnownQuality = null; 232 BestKnownSolution = null; 233 } 199 234 } 200 235 }
Note: See TracChangeset
for help on using the changeset viewer.