Free cookie consent management tool by TermsFeed Policy Generator

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.