Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/07/12 10:52:01 (12 years ago)
Author:
spimming
Message:

#1894

  • bidirectional version of Dijkstra algorithm
  • method to get neighbors of a node in reversed order
  • check for roundabouts in OneWay property
Location:
branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Graph.cs

    r8408 r8423  
    3535        foreach (Vertex<Node> neighbor in vertices) {
    3636          if (edge.CanBeTraversed(vertex.Node, neighbor.Node)) {
     37            float weight = GetWeight(edge, vertex, neighbor);
     38            neighbors[neighbor.Node.Id] = weight;
     39          }
     40        }
     41      }
     42      return neighbors;
     43    }
     44
     45    public Dictionary<long, float> GetNeighborsReversed(long id) {
     46      Vertex<Node> vertex = GetVertex(id);
     47      Dictionary<long, float> neighbors = new Dictionary<long, float>();
     48      List<Way> edges = GetEdges(vertex);
     49      foreach (Way edge in edges) {
     50        List<Vertex<Node>> vertices = GetNeighborVerticesOnEdge(edge, vertex);
     51        foreach (Vertex<Node> neighbor in vertices) {
     52          if (edge.CanBeTraversed(neighbor.Node, vertex.Node)) {
    3753            float weight = GetWeight(edge, vertex, neighbor);
    3854            neighbors[neighbor.Node.Id] = weight;
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm/TagConstants.cs

    r8369 r8423  
    33  public class TagConstants {
    44    public const string HighwayTagKey = "highway";
     5    public const string JunctionTagKey = "junction";
    56    public const string OneWayTag = "oneway";
     7    public const string RoundaboutValue = "roundabout";
    68    public const string YesValue = "yes";
     9    public const string TrueValue = "true";
    710  }
    811}
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm/Way.cs

    r8408 r8423  
    7373        if (base.Tags.ContainsKey(TagConstants.OneWayTag)) {
    7474          string value = base.Tags[TagConstants.OneWayTag];
    75           return value.Equals(TagConstants.YesValue);
     75          return value.Equals(TagConstants.YesValue) || value.Equals(TagConstants.TrueValue);
     76        } else if (base.Tags.ContainsKey(TagConstants.JunctionTagKey)) {
     77          string value = base.Tags[TagConstants.JunctionTagKey];
     78          return value.Equals(TagConstants.RoundaboutValue);
    7679        } else {
    7780          return false;
Note: See TracChangeset for help on using the changeset viewer.