Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Using numpy for traci commands

Dear sumo-user,


is there a possibility using numpy-array instead of for-queue's for traci commands? I tried it, but failed.

For example, I want to update every edge with the current travel-time with a for-queue:

def edge_traveltime_adaption(edges_all):
for edges in edges_all:
edge_time = traci.edge.getTraveltime(edges)
traci.edge.adaptTraveltime(edges, edge_time)
Because it needs a lot of computation time, I want to do it with numpy:

def edge_traveltime_adaption_numpy(edges_all):
edges = np.array(edges_all)
edge_time = traci.edge.getTraveltime(edges)
traci.edge.adaptTaveltime(edges, edge_time)

But it doesn't work like this. Could you help?

Best regards, Pascal


Back to the top