Hi Moritz, the step is indeed useless (step += 1 was used to count the simulation steps but it is not evaluated in this script as far as I can see). The source code for traci.simulationStep is in sumo/tools/traci/__init__.py. May I ask what your plans are in extending sumo and/or traci?
Best regards and Happy New Year to you too, Michael 2014/1/2 Moritz Schwarzkopf, BBT-71 <[email protected]>: > Hello, > > def run(): > """execute the TraCI control loop""" > traci.init(PORT) > programPointer = len(PROGRAM)-1 > step = 0 > while traci.simulation.getMinExpectedNumber() > 0: > traci.simulationStep() > programPointer = min(programPointer+1, len(PROGRAM)-1) > no = traci.inductionloop.getLastStepVehicleNumber("0") > if no > 0: > programPointer = (0 if programPointer == len(PROGRAM)-1 else 3) > traci.trafficlights.setRedYellowGreenState("0", > PROGRAM[programPointer]) > step += 1 > traci.close() > sys.stdout.flush() > > This part is from the TraCI tutorial. My question is, what does step += 1 do, > and where is it used? > And what does traci.simulationStep() do, and where can I find the definition > or python script for this. > > > Thank you very much and a happy new year, > > Moritz > > > --------------------------------------------------------------- > Moritz Schwarzkopf > International Intern > BBT-71, Plant Structure Development Dadong > BMW Brilliance Automotive Ltd. / 华晨宝马汽车有限公司 > Mobile : +86 155 2447 2481 > Mail to / 邮箱: > [email protected]<mailto:[email protected]> > --------------------------------------------------------------- > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > sumo-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/sumo-user ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ sumo-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sumo-user
