ELASTICPATHING/SOURCECODE/UbiComp2014/Elastic_Pathing_Code/navigator.rb
#Find nodes that connect to this one
Find nodes that connect to this one
Find nodes that connect to this one
def intersect(node)
    adjs = []
    @map_data.execute("SELECT wid, to_nid FROM adjacencies WHERE from_nid = #{node.nid};"){|r| 
      wid = r['wid'].to_i
      nid = r['to_nid'].to_i
      lat = @nodes.get_lat(nid)
      lon = @nodes.get_lon(nid)
      adjs.push(Node.new(nid, lat, lon, wid))
    }
    return adjs
  end
def intersect ( node ) adjs = [ ] @map_data . execute ( "SELECT wid, to_nid FROM adjacencies WHERE from_nid = #{node.nid};" ) { | r | wid = r [ 'wid' ] . to_i nid = r [ 'to_nid' ] . to_i lat = @nodes . get_lat ( nid ) lon = @nodes . get_lon ( nid ) adjs . push ( Node . new ( nid , lat , lon , wid ) ) } return adjs end
Find nodes that connect to this one
Find nodes that connect to this one
#Use adjacency list from the adjacencies table to look up adjacent nodes
node