def plot_for_truck(k):
global depot, customers
n = len(customers)
x = [element.x for element in customers[1:]]
y = [element.y for element in customers[1:]]
plt.scatter(x, y)
plt.scatter(depot.x, depot.y, c="r")
truck = trucks[k]
x2 = []
y2 = []
x2.append( depot.x )
y2.append( depot.y )
cs = truck.ordered_customers
for c in cs:
x2.append( c.x )
y2.append( c.y )
x2.append( depot.x )
y2.append( depot.y )
colors = ["b","g","r","c","m","k"]
ipdb.set_trace()
plt.plot(x2, y2, c=colors[k], linewidth=3)
# plt.show()
评论列表
文章目录