Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8514


Ignore:
Timestamp:
08/21/12 15:53:54 (12 years ago)
Author:
spimming
Message:

#1894: experimented with different settings in cost and heuristic function

Location:
branches/RoutePlanning
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning.Test/Program.cs

    r8509 r8514  
    3030
    3131      //IDataSource ds = TestLoad(typeof(XmlDataSource), file7);
    32       IDataSource ds = TestLoad(typeof(OsmDataSource), file6);
     32      //IDataSource ds = TestLoad(typeof(OsmDataSource), file6);
    3333      //OsmGraph graph = new OsmGraph(ds);
    3434
    3535      //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);
    3741
    3842      //IDataSource ds = new DIMACSDataSource(fileNYCoords, fileNYArcs);
     
    7074      //TestLoadAndRouter(file6, typeof(BidrectionalDijkstraAlgorithm), 529102170, 31372732, false, true); // inz - hgb
    7175
     76      TestLoadAndRouterNew(file6, typeof(AStarAlgorithmV3), 529102170, 31372732, false, true); // inz - hgb
    7277      //TestLoadAndRouterNew(file6, typeof(DijkstraAlgorithmV2), 529102170, 31372732, false, true);
    7378      //TestLoadAndRouterNew(file6, typeof(BidrectionalDijkstraAlgorithmV2), 529102170, 31372732, false, true);
     
    166171      Console.Write("Loading data ... ");
    167172      var sw = Stopwatch.StartNew();
    168       XmlDataSource xmlDs = new XmlDataSource(filepath);
     173      //XmlDataSource xmlDs = new XmlDataSource(filepath);
     174      IDataSource xmlDs = new OsmDataSource(filepath);
    169175      sw.Stop();
    170176      Console.WriteLine("done.");
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Graph.cs

    r8512 r8514  
    142142
    143143    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
    147151      int speed = edge.GetMaxSpeed();
     152      double weight = (distance / speed) * 60;
    148153      //double weight = (distance / speed) * 3.6;
    149       double weight = (distance / speed);
     154      //double weight = (distance / speed);
     155      //double weight = distance;
    150156      return (float)weight;
    151157    }
     
    158164
    159165    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;
    164177      //double costs = (distance / speed) * 3.6;
    165       double costs = (distance / speed);
     178      //double costs = (distance / speed);
     179      //double costs = distance;
    166180      return (float)costs;
    167181    }
Note: See TracChangeset for help on using the changeset viewer.