Hello !
I read an email on the sumo-user website and I am in the same situation as
P.B. in his following mail :
"I made a sumo simulation which is initiated by mypython.py (which
calls .net.xml and .rou.xml files). I have traci.vehicle commands for
lane changing which i call from the script. In VEINS we use
erlangen.launchd.xml file to call for the input files of the sumo
configuration, what i want to do is call mypython.py and start
everything."
I tried the given solution,
I change sumo by sumo-launchd in my python.py file :
import traci
PORT = 8002
if not traci.isEmbedded():
#run simulation
sumoProcess = subprocess.Popen("%s -vv -c %s" %
('./sumo-launchd.py', '/usr/local/src/sumo-0.22.0/bin/'), shell=True,
stdout=sys.stdout)
traci.init(PORT)
*"blabla...commands with traci.trafficlights.... in python ...*"
Then I modified the line 420 (remote_port= find_unused_port() ) in
sumo-launchd.py by :
remote_port = 8002 #replace r
And the line 209 (sumo = subprocess.Popen(cmd, cwd=runpath, stdin=None,
stdout=sumoLogOut, stderr=sumoLogErr)) by :
sumoBinary = checkBinary('sumo-gui')
sumo = subprocess.Popen("%s -c %s" % (sumoBinary, "map.sumo.cfg"),
shell=True, stdin=None, stdout=sumoLogOut, stderr=sumoLogErr)
but it doesn't worked, the simulation turns well on Omnetpp but without
considering my script : *"blabla...commands with traci in python ...*"
I wrote an email to P.B, unfortunately he changes his script python in C++
to solve the problem, and I don't pratice C++ ;-(
I really need your help... Please...
Thanks a lot in advance...
Best regards,
Marie-Ange
2014-12-14 20:47 GMT+01:00 Christoph Sommer <[email protected]>:
>
> Dear Marie-Ange,
>
> would you mind posting this to the mailing list?
>
> Best,
>
> Christoph
>
> Marie-Ange Lebre wrote:
> > Dear Christoph,
> >
> > Forgive me to contact you instead of the sumo user list. But I read an
> > email exchange between you and Pavlos Basaras and I am in the same
> > situation as him in his following mail :
> >
> > "I made a sumo simulation which is initiated by mypython.py (which calls
> .net.xml and .rou.xml files). I have traci.vehicle commands for lane
> changing which i call from the script. In VEINS we use erlangen.launchd.xml
> file to call for the input files of the sumo configuration, what i want to
> do is call mypython.py and start everything."
> >
> >
> > I tried the given solution,
> >
> > I change sumo by sumo-launchd in my python.py file :
> >
> > import traci
> > PORT = 8002
> > if not traci.isEmbedded():
> > #run simulation
> > sumoProcess = subprocess.Popen("%s -vv -c %s" %
> > ('./sumo-launchd.py', '/usr/local/src/sumo-0.22.0/bin/'), shell=True,
> > stdout=sys.stdout)
> > traci.init(PORT)
> >
> > *"blabla...commands with traci.trafficlights.... in python ...*"
> >
> >
> > Then I modified the line 420 (remote_port= find_unused_port() ) in
> > sumo-launchd.py by :
> >
> > remote_port = 8002 #replace r
> >
> > And the line 209 (sumo = subprocess.Popen(cmd, cwd=runpath, stdin=None,
> > stdout=sumoLogOut, stderr=sumoLogErr)) by :
> >
> > sumoBinary = checkBinary('sumo-gui')
> > sumo = subprocess.Popen("%s -c %s" % (sumoBinary, "map.sumo.cfg"),
> > shell=True, stdin=None, stdout=sumoLogOut, stderr=sumoLogErr)
> >
> >
> > but it doesn't worked, the simulation turns well on Omnetpp but without
> > considering my script : *"blabla...commands with traci in python ...*"
> >
> > I wrote an email to Pavlos, unfortunately he changes his script python
> > in C++ to solve the problem, and I don't pratice C++ ;-(
> > I really need your help... Please...
> > Thanks a lot in advance...
> > Best regards,
> >
> > Marie-Ange
>
>
>
>
> --
> Dr. Christoph Sommer
> Distributed Embedded Systems Group
> University of Paderborn, Germany
> http://www.ccs-labs.org/~sommer/
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user