Closed Frzgunr1 closed 9 months ago
Hello @Frzgunr1, I am not quite certain of your intention here so I am going to try to describe what I think I am hearing.
The traffic model can be configured in the scenario
SUMO traffic can be selected in the scenario this way:
# loop/scenario.py
Traffic(
engine="SUMO", # "SMARTS" for SMARTS implementation
...
)
My understanding is that if you are using SUMO
traffic the model is a modified Krauss
as is noted on this page They mention it is a combination of Krauss
and safety metrics.
Selecting "SMARTS" causes the simulation to use the following traffic implementation: https://github.com/huawei-noah/SMARTS/blob/b9aceac155cbd187fcb848a1e8448f9d326d2c54/smarts/core/sumo_traffic_simulation.py#L55
This forwards to the selected SUMO traffic model ( MSCFModel_{MODEL_NAME}.cpp
) which is currently "Krauss":
The options for each model are given here:
The current "Krauss" parameters can be configured through the traffic actor: https://github.com/huawei-noah/SMARTS/blob/b9aceac155cbd187fcb848a1e8448f9d326d2c54/smarts/sstudio/types/actor/traffic_actor.py#L34-L65
and used like this: https://github.com/huawei-noah/SMARTS/blob/b9aceac155cbd187fcb848a1e8448f9d326d2c54/scenarios/sumo/intersections/2lane/scenario.py#L16-L23
If you need a different model then "Krauss" I can add that in fairly quickly.
If you are using SMARTS
traffic it is a bit less clear, it is mostly similar to the SUMO Krauss
implementation but the lane changing model is a bit coupled.
Selecting "SMARTS" causes the simulation to use the following traffic implementation: https://github.com/huawei-noah/SMARTS/blob/b9aceac155cbd187fcb848a1e8448f9d326d2c54/smarts/core/local_traffic_provider.py#L67
The current parameters supported are:
# traffic model
minGap
accel
decel
emergencyDecel
sigma
tau
# vehicle
speedFactor
speedDev
# lc model
lcHoldPeriod
lcAssertive
lcCutinProb
lcDogmatic
lcSlowdownAfter
lcMultiLaneCutin
# junction model
jmYieldToAgents
jmWaitToRestart
They can be used specified similarly to here: https://github.com/huawei-noah/SMARTS/blob/b9aceac155cbd187fcb848a1e8448f9d326d2c54/scenarios/sumo/straight/cutin_2lane_agents_1/scenario.py#L20-L28
Another possibility is that you can implement your own TrafficProvider
if necessary as described here:
https://github.com/huawei-noah/SMARTS/issues/1870#issuecomment-1480381436
Thank you @Gamenot very much for your suggestion!
I checked SMARTS/smarts/core/sumo_traffic_simulation.py
s source code and SUMO's docs, and as I understand it, smarts is created by the _ create_vehicle()
method to generate the vehicle flow.
So, just add
self._traci_conn.vehicle.add(vehicle_id, carFollowModel="IDM")
at the end of the method
_create_vehicle()
to realize that the car flow becomes an IDM model.The other sumo heel chi models are also similar.
I'm not sure if my understanding and modification is correct, could you please confirm this for me, thank you very much!
High Level Description
Problems
Version
1.4.0
Operating System
ubuntu 20.04