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
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
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
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
def set_goal_by_coordinates(self,goal): self.goal = mesh_grid5.find_node(goal[0],goal[1])
def set_goal_by_coordinates(self, goal): self.goal = mesh_grid5.find_node(goal[0], goal[1])