mach
mach

Reputation: 1

Simulation in SUMO with netconvert

I am trying to run a simulation with Sumo using TRACI in python as a way to perform some actions in the simulation. What I am doing is basically using netconvert to extract a portion of the map.

netconvert --keep-edges.in-boundary minX,minY,maxX,maxY -s large.net.xml -o small.net.xml

So basically I am trying to perform an evaluation in the original net(large.net.xml) and in some point of the simulation transfer a vehicle from the original simulation to my small network(small.net.xml) with the option:

conn2.vehicle.add(vehID='0',routeID='R0',depart=time,departPos=conn1.vehicle.getLanePosition('0'),departSpeed=conn1.vehicle.getSpeed('0'))

where time is the simulation time in my original simulation(conn1). This should take the vehicle in simulation conn1 and start that vehicle in conn2(Simulation with small.net.xml) in that exact same position that it was in conn1, but it seems that my cropped network has different sizes regarding that lane as the vehicle start in a position a little different. Is there a way to avoid these changes in the size of the lanes? I have tried this with transferring the vehicle to the same original network in conn2 and it appears in the desired position.

Upvotes: 0

Views: 254

Answers (1)

Michael
Michael

Reputation: 3680

The easiest solution is probably to make the cropped network a little larger (containing all edges directly adjacent to the current cropped network) in order to ensure that the edges of interest have still the same junction geometries on the beginning and the end node.

Upvotes: 0

Related Questions