Setting/Randomizing Ego Initial State

Dear community,
I figured out, that there is an option of having obstacle vehicles randomized within a sumo simulation. (random seed = None)

But I struggle to randomize the ego initial state by either letting it randomize by sumo or randomizing it from the python script. How can this be done?

A related question is the following: In the SUMO vehicle definition there an entry for vehicle id = “egoVehicle6”, which I guess i meant to be used as ego vehicle? It is set to random states in the config file. Only the ego vehicle starts at a “non-random” position in my simulations.
vehicle id=“egoVehicle6” depart=“2.57” departLane=“free” departPos=“random_free” departSpeed=“max”
route edges=“7 23 11 26 15” /
/vehicle

Thanks in advance!
Rudolf

Dear Rudolf,

thanks for your message. If I got you correctly, you aim to manipulate the initial state of a planning problem. Is that correct? In that case, I would suggest you to either adjust the values after reading in the scenario file or to change the entry in the xml file of the CommonRoad scenario before (manually / with a script).

Does this answer your question? Which steps did you test so far to solve the problem?

Best regards,
Florian

Hi Florian!
I struggle a little bit with redefining sumo aligned with common road data structures. I solved the problem by setting the parameter “random_seed” of the pickle file to a an according value.

The current problem I have is the following. The simulated vehicles have a certain sequence of lane-lets which they follow and which is the middle lane for some reason. I want it to be the rightmost lane, but do not know how to redefine it. There is this file “DEU_Cologne-63_5_I-1.vehicle.rou.xml” with a definition , which seem to be the middle lane lane-let numbers. Once I set the numbers to another lane, e.g. , the following error appears:

libsumo.libsumo.FatalTraCIError: The edge ‘6’ within the route for vehicle ‘4’ is not known.
The route can not be build.

Obviously, there must be another definition and I am doing something wrong. Where is the right file to change it?

A futher problem is, how to define the max speed of vehicles. When I set e.g., conf.overwrite_speed_limit = 5, neither does setting maxSpeed for vehicles in “DEU_Cologne-63_5_I-1.vehicle.rou.xml”.
I am not sure which files and parameters are overwritten by other files.

Thanks for you help!
Best,
Rudolf