0

I am trying to give --max-depart-delay option with sumo but doesn't proceed. How I can pass options to sumo with sumo-launchd.py ?

I have tried following command

sumo-launchd.py -vv -c sumo --max-depart-delay -1

B.Gao
  • 146
  • 1
  • 8
Sam1324
  • 387
  • 2
  • 13

1 Answers1

2

sumo-launchd.py executes the command given by the -c option. By default this is sumo which is resolved by searching your $PATH variable.

When you execute the given command, python interprets --max-depart-delay as another argument for sumo-launchd.py which does not make sense because it does not exist:

Usage: sumo-launchd.py [options]

sumo-launchd.py: error: no such option: --max-depart-delay

Therefore, you want to indicate that max-depart-delay is an option for the SuMO command to be executed and not for the launch daemon by surrounding it with '' or "":

sumo-launchd.py -vv -c 'sumo --max-depart-delay -1'

sumo-launchd.py -vv -c "sumo --max-depart-delay -1"

Logging to /tmp/sumo-launchd.log

Listening on port 9999

Julian Heinovski
  • 1,822
  • 3
  • 16
  • 27
  • I am getting following error now: `Could not start SUMO (sumo --max-depart-delay -1 -c test.sumo.cfg): [Errno 2] No such file or directory` – Sam1324 Aug 17 '17 at 07:56
  • it seems SuMO can't find your config file.I recommend you test the command which you want the launch daemon to execute manually beforehand. In your case this would be `sumo --max-part-delay -1 -c test.sumo.cfg`. – Julian Heinovski Aug 17 '17 at 16:23
  • I had tested the command, `sumo --max-part-delay -1 -c test.sumo.cfg` it works fine. I tried many other options with sumo-launchd.py but nothing works. With any option, i get same error `No such file or directory` – Sam1324 Aug 17 '17 at 19:51
  • The `sumo-launchd.py` is a script to launch a SuMO deamon which waits for input from the `TraCIScenarioManagerLaunchd` module. Every input including the scenario and config files are sent to the deamon via the TraCI protocol (see http://veins.car2x.org/documentation/sumo-launchd/) and therefore are specified in `omnetpp.ini` and not directly via arguments. – Julian Heinovski Sep 04 '17 at 12:59
  • so where do I specify --max-part-delay option? – Sam1324 Sep 06 '17 at 20:46
  • Maybe, my comment was not clear enough: SuMO parameters like `max-part-delay` are specified via the command to be executed (as shown above). However, the scenario dependent files like `test.sumo.cfg` are specified in the [launchd config file](https://github.com/sommer/veins/blob/veins-4.6/examples/veins/erlangen.launchd.xml) which in turn is specified in [`omnetpp.ini`](https://github.com/sommer/veins/blob/veins-4.6/examples/veins/omnetpp.ini#L49) because it is given to SuMO via the TraCI protocol. Thus, put the parameters in the command and the scenario in the launchd config file. – Julian Heinovski Sep 08 '17 at 13:28
  • I get what you are implying to tell me but the config file is defined in the xml file since the command `sumo-launchd.py -vv -c sumo` works absolutely great but not `sumo-launchd.py -vv -c "sumo --max-depart-delay -1" ` or `sumo-launchd.py -vv -c 'sumo --max-depart-delay -1'` – Sam1324 Sep 11 '17 at 21:21
  • Both command versions you gave should and do indeed work perfectly fine, at least on my machine. Since you accepted this answer, I thought your issue was solved. – Julian Heinovski Sep 12 '17 at 09:32
  • Works for me: `julian@linux: ./sumo-launchd.py -vv -c "sumo --max-depart-delay -1" --> Logging to /tmp/sumo-launchd.log Listening on port 9999` & `julian@linux: ./sumo-launchd.py -vv -c 'sumo --max-depart-delay -1' --> Logging to /tmp/sumo-launchd.log Listening on port 9999` – Julian Heinovski Sep 25 '17 at 08:27
  • This works for me as well but after starting the simulation I get errors. – Sam1324 Sep 26 '17 at 08:50
  • I have tried everything I do get `./sumo-launchd.py -vv -c 'sumo --max-depart-delay -1' --> Logging to /tmp/sumo-launchd.log Listening on port 9999` but as soon as the simulation starts I get error `Could not start SUMO (sumo --max-depart-delay -1 -c test.sumo.cfg): [Errno 2] No such file or directory`. I really need --max-depart-delay for my project. – Sam1324 Oct 17 '17 at 08:32