3

I am a new to SUMO. Can someone help me on how to maintain the constant number of vehicles i.e. constant density, over the complete simulation period like for 1 hr. In this post, they said that using options --begin, --end. I didn't understand how to make use of that option.

Also, It is said that "You can use the option --max-num-vehicles to set the desired number"

Where to execute this option ? Is it with netconvert? Can someone guide me with an example? I mean the full command. Thank you so much.

P.S: I am using SUMO 0.26.0 simulator, windows 10 64bit.

Edit:

after Micheal suggestion I am able to limit the total number of vehicles in the simulation but not able to maintain the same number. Because some of the vehicles are leaving the simulation. Can any one guide me how to maintain the same number of vehicles?

In this post they have mentioned to use Rerouter.But didn't get where should I write retoure attribue.

Should I manually edit my cars.rou.xml file and add some more edges to vechile attribute? someone please guide me. Thank you.

Michael
  • 3,510
  • 1
  • 11
  • 23
vishnu
  • 363
  • 3
  • 20

1 Answers1

2

The following route file could be used together with the net from sumo/examples/sumo/simple_nets/cross/cross1l

<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
    <route id="horizontal" edges="2i 1o 1i 2o 2i"/>
    <flow id="horizontal" route="horizontal" begin="0" end="3600" period="3"
          departPos="last" departSpeed="max"/>
</routes>

It generates a flow of vehicles with maximum departure speed departing every 3 seconds. But if you want to limit the number of vehicles to a constant (let's say 30), you start sumo like this:

sumo-gui -n net.net.xml -r input_routes.rou.xml --max-num-vehicles 30

This will limit the maximum amount of vehicles to 30. To let it end precisely after one hour use the additional --end 3600 option.

Michael
  • 3,510
  • 1
  • 11
  • 23
  • Thank you for the response. Since I need constant vehicles, I took your second suggestion and did like this `sumo-gui -n Munich.net.xml -r cars.rou.xml --max-num-vechicles 30 --end 3600` but getting this error. Error: On processing option '--max-num-vechicles': No option with the name 'max-num-vechicles' exists. Error: The parameter '30' is not allowed in this context. Switch or parameter name expected. Error: Could not parse commandline options. Quitting (on error). Where am I wrong? Thanks – vishnu Jul 02 '16 at 19:27
  • It is just a typo, the option is called `--max-num-vehicles` (without the first "c") – Michael Jul 03 '16 at 12:35
  • My Bad. Thank you. I have a question. The max num vehicles condition is satisfied but there are less number of them now. Because the vehicles are leaving the simulation after some time. What do you suggest to make them stay for the entire period? In the documentation, they have mentioned to use Rerouter. But didn't get how to make use of it. In my cars.rou.xml the vehicle id, depart time and other attributes are mentioned. I have downloaded this file from internet. So do you say that editing this file will help? though i can find only depart time but not leaving out time. – vishnu Jul 03 '16 at 13:02
  • If you want more vehicles just generate more (give a larger end time of the flow). If you want the same vehicles to stay in the simulation for longer you will need rerouters. But maybe we continue the discussion on sumo-user. Please mark the question as answered though. – Michael Jul 04 '16 at 13:11
  • I marked the question just for you. But still, the goal of having constant vehicles is not met :(. I found another [post] (http://sumo.dlr.de/wiki/Tools/Trip#Intermediate_Way_Points) but adding intermediate_way_points didn't help me. Any help on creating reroutes ?I have attached all my files [here](http://permalink.gmane.org/gmane.science.simulation.sumo.user/9712) Thanks – vishnu Jul 04 '16 at 20:02