fix bug during routing
@@ -29,10 +29,10 @@ class Route:
def serialize(self, locations):
nodes = [[node, None] for node in self.path_nodes]
- if self.origin_addition:
+ if self.origin_addition and any(self.origin_addition):
nodes.insert(0, (self.origin_addition[0], None))
nodes[1][1] = self.origin_addition[1]
- if self.destination_addition:
+ if self.destination_addition and any(self.origin_addition):
nodes.append(self.destination_addition)
items = deque()
@@ -41,7 +41,6 @@ class Route:
distance = 0
for i, (node, edge) in enumerate(nodes):
if edge is None:
- print(i)
edge = self.router.edges[last_node, node] if last_node else None
node_obj = self.router.nodes[node] if isinstance(node, (int, np.int32, np.int64)) else node
item = RouteItem(self, node_obj, edge, last_item)
