- Timestamp:
- 07/20/12 18:58:28 (12 years ago)
- Location:
- branches/RoutePlanning
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/DijkstraAlgorithm.cs
r8312 r8314 97 97 } 98 98 route.Add(current); 99 while ( !predecessors.TryGetValue(current, out next)) {99 while (predecessors.TryGetValue(current, out next)) { 100 100 current = predecessors[current]; 101 101 route.Add(current); -
branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning.Test/HeuristicLab.Problems.RoutePlanning.Test.csproj
r8293 r8314 52 52 <None Include="OsmTestFiles\testRelation1.osm" /> 53 53 <None Include="OsmTestFiles\testWay1.osm" /> 54 <None Include="OsmTestFiles\test_mid.osm" /> 54 55 </ItemGroup> 55 56 <ItemGroup> 57 <ProjectReference Include="..\HeuristicLab.Algorithms.GraphRouting\3.3\HeuristicLab.Algorithms.GraphRouting.csproj"> 58 <Project>{4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}</Project> 59 <Name>HeuristicLab.Algorithms.GraphRouting</Name> 60 </ProjectReference> 56 61 <ProjectReference Include="..\HeuristicLab.Problems.RoutePlanning\3.3\HeuristicLab.Problems.RoutePlanning.csproj"> 57 62 <Project>{E93A30BD-D4C8-4DEC-8ECF-2BC3CD9F027B}</Project> -
branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning.Test/Program.cs
r8301 r8314 1 1 2 using System; 3 using HeuristicLab.Algorithms.GraphRouting; 2 4 using HeuristicLab.Problems.RoutePlanning.Osm.Data; 3 5 namespace HeuristicLab.Problems.RoutePlanning.Test { 4 6 class Program { 5 7 static void Main(string[] args) { 6 string filepath = @"..\..\OsmTestFiles\test.osm"; 8 Test1(); 9 } 10 11 private static void Test1() { 12 string filepath = @"..\..\OsmTestFiles\test_mid.osm"; 13 14 Console.Write("Loading data ... "); 15 XmlDataSource xmlDs = new XmlDataSource(filepath); 16 Console.WriteLine("done."); 17 18 Graph.Graph graph = new Graph.Graph(xmlDs); 19 IRouter router = new DijkstraAlgorithm(graph); 20 21 Console.Write("Calculate route ... "); 22 long[] result = router.Calculate(529102170, 1001363194); 23 System.Console.WriteLine("done."); 24 25 Console.Write("Result: "); 26 foreach (long i in result) System.Console.Write(i + "; "); 27 Console.WriteLine(); 28 System.Console.Read(); 29 } 30 31 private static void Test2() { 32 //string filepath = @"..\..\OsmTestFiles\test.osm"; 7 33 //string filepath = @"..\..\OsmTestFiles\testNode1.osm"; 8 34 //string filepath = @"..\..\OsmTestFiles\testWay1.osm"; 9 35 //string filepath = @"..\..\OsmTestFiles\testRelation1.osm"; 36 string filepath = @"..\..\OsmTestFiles\test_mid.osm"; 37 38 Console.Write("Loading data ... "); 10 39 XmlDataSource xmlDs = new XmlDataSource(filepath); 11 //xmlDs.ReadData(); 40 Console.WriteLine("done."); 41 42 Graph.Graph graph = new Graph.Graph(xmlDs); 43 IRouter router = new DijkstraAlgorithm(graph); 44 45 Console.Write("Calculate route ... "); 46 long[] result = router.Calculate(529102170, 1001363194); 47 System.Console.WriteLine("done."); 48 49 Console.Write("Result: "); 50 foreach (long i in result) System.Console.Write(i + "; "); 51 Console.WriteLine(); 52 System.Console.Read(); 12 53 } 13 54 } -
branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Graph.cs
r8308 r8314 35 35 foreach (Vertex<Node> neighbor in vertices) { 36 36 float weight = GetWeight(edge, vertex, neighbor); 37 neighbors[neighbor. Id] = weight;37 neighbors[neighbor.Node.Id] = weight; 38 38 } 39 39 } 40 return n ull;40 return neighbors; 41 41 } 42 42 -
branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/HeuristicLab.Problems.RoutePlanning.csproj
r8308 r8314 59 59 <Compile Include="Graph\Graph.cs" /> 60 60 <Compile Include="Graph\IEdge.cs" /> 61 <Compile Include="Graph\Route.cs" /> 61 62 <Compile Include="Graph\Vertex.cs" /> 62 63 <Compile Include="Osm.Data\XmlDataSource.cs" />
Note: See TracChangeset
for help on using the changeset viewer.