Hello Jakob, Thanks, using "--output-prefix" seems much smarter than copying the files again.
I have stored the path value in a string and append the random seed value to that string before assigning it to the "--output-prefix". Gives me the desired result :) Regards, Vaibhav Rungta Graduate Student - Industrial and Systems Engineering Graduate Assistant - Toyota Production Systems Lab Research Assistant - University Transport Research Center 585-754-7133 On Mon, Mar 13, 2017 at 5:08 AM, Jakob Erdmann <[email protected]> wrote: > you can use the output-prefix option: http://sumo.dlr.de/wiki/ > Basics/Using_the_Command_Line_Applications#Writing_files > > 2017-03-12 21:28 GMT+01:00 Vaibhav Rungta <[email protected]>: > >> Thanks Jakob, >> I can now visualize and automate the simulations. >> >> sumoProcess = subprocess.Popen([sumoBinary, "-c", "simexp.sumo.cfg", "-r", >> "randomroute.rou.xml", >> "--remote-port", str(now_port), "-S", "true", "-Q", "true", >> "--emission-output", "12marEMS.xml", >> "--tripinfo-output", "12marTIPop.xml"], stdout=sys.stdout, >> stderr=sys.stderr) >> >> Next, I want to save the output of all the 10 simulations separately at >> >> a particular destination without over-writing the same file, i.e; with >> >> different names which can from seed value. I am not sure if options will >> >> provide that flexibility. >> >> I am thinking of copying the output file to a particular location. >> >> http://stackoverflow.com/questions/123198/how-do-i-copy-a-file-in-python >> >> Is there a more efficient way to do this? >> >> Regards, >> Vaibhav Rungta >> Graduate Student - Industrial and Systems Engineering >> Graduate Assistant - Toyota Production Systems Lab >> Research Assistant - University Transport Research Center >> 585-754-7133 <(585)%20754-7133> >> >> >> On Fri, Mar 10, 2017 at 3:51 AM, Jakob Erdmann < >> [email protected]> wrote: >> >>> - the simples method for automating runs is to use 'sumo.exe.' instead >>> of 'sumo-gui.exe' >>> - if you require visualization for every run you may set the options >>> --start and --quit-on-end >>> >>> 2017-03-10 5:31 GMT+01:00 Vaibhav Rungta <[email protected]>: >>> >>>> Hello Jakob, >>>> Today I implemented all the recommendations you shared. Thanks:) >>>> >>>> - I changed the environment variable (as per your recommendation) to >>>> SUMO_HOME and it fixed the Warning: Environment variable SUMO_HOME is >>>> not set scheme resolution will use slow website lookups >>>> >>>> - To prevent collisions I have set the speedmode 14 only for the first >>>> vehicle in the queue. I am not getting anymore collision or teleportation >>>> warnings. There are some emergency braking warnings but I guess that will >>>> not affect the analysis. >>>> >>>> - Automation: >>>> I am generating random numbers and using that for the port assignment >>>> and for seed value. It works. >>>> There's one little hiccup though. I have to click on play button >>>> everytime at the end of one simulation to begin the next. >>>> Here' the code: >>>> >>>> PORT = random.sample(range(5000,10000), 10) #generate port for >>>> communicating with sumo instance >>>> >>>> import randomTrips >>>> for now_port in PORT: >>>> randomTrips.main(randomTrips.get_options([ >>>> '--net-file', 'simexp.net.xml', >>>> '--min-distance', '1500', >>>> '--period', '6', >>>> '--binomial', '1', >>>> '--seed', str(now_port), >>>> '--trip-attributes', 'type = \"vdis\"', >>>> '--additional-file', 'vdis1.add.xml', >>>> '--route-file', 'randomroute.rou.xml'])) >>>> #sumo is started as a subprocess >>>> sumoBinary = "C:/Folder/sumo-0.28.0/bin/sumo-gui.exe" >>>> #sumoBinary is a variable which holds the path to sumo-gui, you can >>>> any name for this variable >>>> sumoProcess = subprocess.Popen([sumoBinary, "-c", "simexp.sumo.cfg", >>>> "-r", "randomroute.rou.xml", >>>> "--remote-port", str(now_port)], >>>> stdout=sys.stdout, stderr=sys.stderr) >>>> import traci >>>> traci.init(now_port) >>>> step = 0 #initiates the step, last time u deleted this command >>>> and spent 90 mins to figure out why the code is not working 1/20/17 >>>> #stopped_veh = [] #creating an empty >>>> list, this will be used in later sections of the code >>>> while traci.simulation.getMinExpectedNumber() > 0: >>>> traci.simulationStep() >>>> step += 1 >>>> traci.close() >>>> >>>> Kindly suggest how I may automate the step for opening and closing >>>> specific runs as well. >>>> >>>> *Whats' next*: >>>> >>>> -I'll begin saving each of these outputs in separate files to begin >>>> analysis. >>>> >>>> Cheers to your team :) >>>> >>>> >>>> Regards, >>>> Vaibhav Rungta >>>> Graduate Student - Industrial and Systems Engineering >>>> Graduate Assistant - Toyota Production Systems Lab >>>> Research Assistant - University Transport Research Center >>>> 585-754-7133 <(585)%20754-7133> >>>> >>>> >>>> On Tue, Mar 7, 2017 at 2:23 AM, Jakob Erdmann < >>>> [email protected]> wrote: >>>> >>>>> Hello, >>>>> 1) the only environment variable that is relevant for sumo is the >>>>> variable SUMO_HOME. it should be set to the base directory of sumo (the >>>>> directory that contains bin and tools). Your variable sumo-0.28.0 has no >>>>> effect >>>>> 2) SUMO requires python2.7. We try to add support for python 3 over >>>>> time and so far traci and sumolib should work. However, in 0.29.0 some >>>>> things that reduced python 3.0 compatibility slipped through. It is >>>>> recommended to use the latest development version if you must use python >>>>> 3.0 >>>>> 3) port can be any random number (above 1000 should be fine as the >>>>> lower ones are reserved for system services). If you use the function >>>>> traci.start['sumo', '-c', 'myconfig.sumocfg']) a free port will be found >>>>> automatically and sumo started listening on that port and traci connected >>>>> to it. >>>>> >>>>> regards, >>>>> Jakob >>>>> >>>>> 2017-03-04 19:57 GMT+01:00 Vaibhav Rungta <[email protected]>: >>>>> >>>>>> Hello Jakob, >>>>>> Hope You're doing great! >>>>>> >>>>>> I apologize for not writing these queries to sumo-user@ >>>>>> lists.sourceforge.net and rather personally to you. I was having a >>>>>> difficult time explaining the warning messages and my doubts and >>>>>> therefore >>>>>> I have created a small slide show which might make it easy for me express >>>>>> my queries. >>>>>> Kindly help me figure out a way. >>>>>> >>>>>> I was wondering (if your time permits), may be we can schedule a chat >>>>>> session some time depending on your availability. I believe a >>>>>> conversation >>>>>> with you can help me avoid some usual pitfalls I face and might enhance >>>>>> my >>>>>> understanding of documentation. >>>>>> >>>>>> Regards, >>>>>> Vaibhav Rungta >>>>>> Graduate Student - Industrial and Systems Engineering >>>>>> Graduate Assistant - Toyota Production Systems Lab >>>>>> Research Assistant - University Transport Research Center >>>>>> 585-754-7133 <(585)%20754-7133> >>>>>> >>>>>> >>>>> >>>> >>> >> > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ sumo-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sumo-user
