Changeset 8514
- Timestamp:
- 08/21/12 15:53:54 (12 years ago)
- Location:
- branches/RoutePlanning
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning.Test/Program.cs
r8509 r8514 30 30 31 31 //IDataSource ds = TestLoad(typeof(XmlDataSource), file7); 32 IDataSource ds = TestLoad(typeof(OsmDataSource), file6);32 //IDataSource ds = TestLoad(typeof(OsmDataSource), file6); 33 33 //OsmGraph graph = new OsmGraph(ds); 34 34 35 35 //IGraph graphNew = TestGetRoutingGraph(ds); 36 //ExecuteBenchmark(graphNew, typeof(AStarAlgorithmV3), 2048, 1000); 36 //ExecuteBenchmark(graphNew, typeof(AStarAlgorithmV3), 262144, 20); 37 38 //IRouter router = new AStarAlgorithmV3(graphNew); 39 //long[] r = router.Calculate(266733493, 986825165); 40 ////long[] r = router.Calculate(998717680, 986825165); 37 41 38 42 //IDataSource ds = new DIMACSDataSource(fileNYCoords, fileNYArcs); … … 70 74 //TestLoadAndRouter(file6, typeof(BidrectionalDijkstraAlgorithm), 529102170, 31372732, false, true); // inz - hgb 71 75 76 TestLoadAndRouterNew(file6, typeof(AStarAlgorithmV3), 529102170, 31372732, false, true); // inz - hgb 72 77 //TestLoadAndRouterNew(file6, typeof(DijkstraAlgorithmV2), 529102170, 31372732, false, true); 73 78 //TestLoadAndRouterNew(file6, typeof(BidrectionalDijkstraAlgorithmV2), 529102170, 31372732, false, true); … … 166 171 Console.Write("Loading data ... "); 167 172 var sw = Stopwatch.StartNew(); 168 XmlDataSource xmlDs = new XmlDataSource(filepath); 173 //XmlDataSource xmlDs = new XmlDataSource(filepath); 174 IDataSource xmlDs = new OsmDataSource(filepath); 169 175 sw.Stop(); 170 176 Console.WriteLine("done."); -
branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Graph.cs
r8512 r8514 142 142 143 143 public float GetWeight(Edge<Vertex> edge) { 144 double distance = Utils.Distance(edge.Source.Logitude, edge.Source.Latitude, 145 edge.Target.Logitude, edge.Target.Latitude); 146 //double distance = Utils.LocationDistance(source.Node.Point, target.Node.Point); 144 //double distance = Utils.Distance(edge.Source.Logitude, edge.Source.Latitude, 145 // edge.Target.Logitude, edge.Target.Latitude); 146 147 PointD s = new PointD(edge.Source.Logitude, edge.Source.Latitude); 148 PointD t = new PointD(edge.Target.Logitude, edge.Target.Latitude); 149 double distance = Utils.LocationDistance(s, t); 150 147 151 int speed = edge.GetMaxSpeed(); 152 double weight = (distance / speed) * 60; 148 153 //double weight = (distance / speed) * 3.6; 149 double weight = (distance / speed); 154 //double weight = (distance / speed); 155 //double weight = distance; 150 156 return (float)weight; 151 157 } … … 158 164 159 165 public float EstimatedCosts(Vertex source, Vertex target) { 160 double distance = Utils.Distance(source.Logitude, source.Latitude, 161 target.Logitude, target.Latitude); 162 //double distance = Utils.LocationDistance(source.Node.Point, target.Node.Point); 163 int speed = 10; 166 //double distance = Utils.Distance(source.Logitude, source.Latitude, 167 // target.Logitude, target.Latitude); 168 169 PointD s = new PointD(source.Logitude, source.Latitude); 170 PointD t = new PointD(target.Logitude, target.Latitude); 171 double distance = Utils.LocationDistance(s, t); 172 173 //int speed = 130; 174 //int speed = 10; 175 int speed = 1; 176 double costs = (distance / speed) * 60; 164 177 //double costs = (distance / speed) * 3.6; 165 double costs = (distance / speed); 178 //double costs = (distance / speed); 179 //double costs = distance; 166 180 return (float)costs; 167 181 }
Note: See TracChangeset
for help on using the changeset viewer.