コード例 #1
0
ファイル: mapvisuallarge.py プロジェクト: Chiru/chiru-extras
def create_route(source,destination):
    a = mesh_grid5.find_node(source)
    b = mesh_grid5.find_node(destination)
    route = mesh_grid5.search_path(a,b)
    edges = mesh_grid5.search_portals(a,b)
    funnelpoints = string_pull(route,edges)
    return funnelpoints
コード例 #2
0
def create_route(source, destination):
    a = mesh_grid5.find_node(source)
    b = mesh_grid5.find_node(destination)
    route = mesh_grid5.search_path(a, b)
    edges = mesh_grid5.search_portals(a, b)
    funnelpoints = string_pull(route, edges)
    return funnelpoints
コード例 #3
0
ファイル: Pedestrian.py プロジェクト: Chiru/chiru-extras
 def set_path(self):
     location = mesh_grid5.find_node(self.x,self.y)
     if location == None: location = find_closest([self.x,self.y])
     # Jos joutuu tyhjalle niin nakojaan osaa itse kavella lahimpaan
     #print "Location: ",location
     route = mesh_grid5.search_path(location,self.goal)
     if route == None:
         #pdb.set_trace() 
         #print "No route, what happens?"
         self.destnumber = 0
         return None
     self.routenodes = [r[1] for r in route]
     edges = mesh_grid5.search_portals(location,self.goal)
     self.path = string_pull([r[0] for r in route],edges)
     self.destnumber = 0
コード例 #4
0
 def set_path(self):
     location = mesh_grid5.find_node(self.x, self.y)
     if location == None: location = find_closest([self.x, self.y])
     # Jos joutuu tyhjalle niin nakojaan osaa itse kavella lahimpaan
     #print "Location: ",location
     route = mesh_grid5.search_path(location, self.goal)
     if route == None:
         #pdb.set_trace()
         #print "No route, what happens?"
         self.destnumber = 0
         return None
     self.routenodes = [r[1] for r in route]
     edges = mesh_grid5.search_portals(location, self.goal)
     self.path = string_pull([r[0] for r in route], edges)
     self.destnumber = 0
コード例 #5
0
ファイル: Pedestrian.py プロジェクト: Chiru/chiru-extras
 def set_goal_by_coordinates(self,goal):
     self.goal = mesh_grid5.find_node(goal[0],goal[1])
コード例 #6
0
 def set_goal_by_coordinates(self, goal):
     self.goal = mesh_grid5.find_node(goal[0], goal[1])