Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/20/12 17:32:19 (12 years ago)
Author:
spimming
Message:

#1894:
Dijkstra: get node with a specific rank
graph interface extended: get vertices
fixed bug in ReadData method
methods to perform routing algorithm benchmark added to test program

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

    r8479 r8509  
    2525      vertices.TryGetValue(id, out vertex);
    2626      return vertex;
     27    }
     28
     29    public List<Vertex> GetVertices() {
     30      return new List<Vertex>(vertices.Values);
    2731    }
    2832
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/IGraph.cs

    r8479 r8509  
    55    void AddVertex(Vertex vertex);
    66    Vertex GetVertex(long id);
     7    List<Vertex> GetVertices();
    78    void AddEdge(long startId, long endId);
    89    void AddEdge(Edge<Vertex> edge);
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm.Data/OsmDataSource.cs

    r8504 r8509  
    141141      NameTable nt = new NameTable();
    142142      string osmName = nt.Add("osm");
    143       string nodeName = nt.Add("node");
     143      object nodeName = nt.Add("node");
    144144      object tagName = nt.Add("tag");
    145145      object wayName = nt.Add("way");
     
    147147      string lonName = nt.Add("lon");
    148148      string idName = nt.Add("id");
    149       string ndName = nt.Add("nd");
     149      object ndName = nt.Add("nd");
    150150      string refName = nt.Add("ref");
    151151      string kName = nt.Add("k");
     
    166166
    167167          reader.Read();
    168           if (reader.LocalName.Equals(tagName)) {
    169             reader.ReadToFollowing(nodeName, ns);
    170           }
    171         }
    172         while (reader.LocalName.Equals(wayName)) {
     168          //if (reader.LocalName.Equals(tagName)) {
     169          if (ReferenceEquals(tagName, reader.LocalName)) {
     170            reader.ReadToFollowing((string)nodeName, ns);
     171          }
     172        }
     173        //while (reader.LocalName.Equals(wayName)) {
     174        while (ReferenceEquals(wayName, reader.LocalName)) {
    173175          List<Vertex> way = new List<Vertex>();
    174176          bool missingNodes = false;
     
    177179
    178180          reader.Read();
    179           while (reader.LocalName.Equals(nodeName) || reader.LocalName.Equals(tagName)) {
     181          while (ReferenceEquals(ndName, reader.LocalName) || ReferenceEquals(tagName, reader.LocalName)) {
    180182            if (reader.LocalName.Equals(ndName)) {
    181183              long refNodeId = XmlConvert.ToInt64(reader.GetAttribute(refName, ns));
Note: See TracChangeset for help on using the changeset viewer.