Replies: 2 comments 1 reply
-
Hey @phil-hei, could you extend a little bit on your question, also example configuration always help. Alternatively, there is the option to "close" lanes using TMC's Lastly, if you just want a static obstacle throughout the simulation, there is the option of placing a halting vehicle (see for example here), which will be evaded by other vehicles automatically. I hope these ideas help you to solve your issue, please feel free to elaborate! |
Beta Was this translation helpful? Give feedback.
-
I found a thread in the SUMO mailing list which suggests to just add a vehicle and stop it immediately at their spawn position to mimic an obstacle that other vehicles can react to and overtake it. You can either do that the "right" way, by adding a specific application which stops a vehicle as soon as it spawns, or by "hacking" the SumoAmbassador. By spawning a vehicle and using a custom application which stops the vehicle (might not be accurate enough):
or by spawning a specific vehicle of type "Obstacle" and then adjusting the SumoAmbassador in line 302: - bridge.getSimulationControl().addVehicle(vehicleId, routeId, vehicleType, laneId, departPos, departSpeed);
+ if (vehicleType.equals("Obstacle")) {
+ bridge.getSimulationControl().addVehicle(vehicleId, routeId, vehicleType, laneId, departPos, "0");
+ bridge.getVehicleControl().stop(vehicleId, routes.get(routeId).getConnectionIds().iterator().next(), vehicleRegistration.getDeparture().getDeparturePos(), vehicleRegistration.getDeparture().getDepartureLane(), Long.MAX_VALUE, VehicleStopMode.STOP);
+} else {
+ bridge.getSimulationControl().addVehicle(vehicleId, routeId, vehicleType, laneId, departPos, departSpeed);
+} |
Beta Was this translation helpful? Give feedback.
-
Hi,
I just wonder if there is an (easy) way to make sure that environment events, such as an obstacle, are placed on the road network so that vehicle can pass them by. Example: I have a defined simulation area where I want to generate random obstacles on the road. I'm able to generate this events within the simulation area, but haven't found a suitable way to ensure that they are on the road network.
Beta Was this translation helpful? Give feedback.
All reactions