ELASTICPATHING/SOURCECODE/UbiComp2014/Elastic_Pathing_Code/elastic_path.rb
def addPoint(node)
    #New distance to next node is the distance past this one plus the distance
    #to the new node from the one we are currently passing
    @progress = @progress + -1 * node.distance(path[-1])
    putlog "Starting progress to new node (#{node.nid}) -- distance is #{@progress}"
    @path.push(node)
    if (not @hash_path.has_key? node.nid)
      @hash_path[node.nid] = []
    end
    @hash_path[node.nid].push node.wid
  end
#Need to remember the path of nodes and the landmarks passed
#Also remember a 'unique id' that describes the turns on this path.
#Also store a hash map to check if a node has been travelled on before.
Need to remember the path of nodes and the landmarks passed
Also remember a 'unique id' that describes the turns on this path.
Also store a hash map to check if a node has been travelled on before.
Need to remember the path of nodes and the landmarks passed Also remember a ' unique id ' that describes the turns on this path . Also store a hash map to check if a node has been travelled on before .
def addPoint(node)
    @progress = @progress + -1 * node.distance(path[-1])
    putlog "Starting progress to new node (#{node.nid}) -- distance is #{@progress}"
    @path.push(node)
    if (not @hash_path.has_key? node.nid)
      @hash_path[node.nid] = []
    end
    @hash_path[node.nid].push node.wid
  end
def addPoint ( node ) @progress = @progress + - 1 * node . distance ( path [ - 1 ] ) putlog "Starting progress to new node (#{node.nid}) -- distance is #{@progress}" @path . push ( node ) if ( not @hash_path . has_key? node . nid ) @hash_path [ node . nid ] = [ ] end @hash_path [ node . nid ] . push node . wid end
Need to remember the path of nodes and the landmarks passed
Also remember a 'unique id' that describes the turns on this path.
Need to remember the path of nodes and the landmarks passed Also remember a ' unique id ' that describes the turns on this path .
#New distance to next node is the distance past this one plus the distance #to the new node from the one we are currently passing
node