Hello, step += 1 is a shorthand for step = step + 1 The variable 'step' is used to count the simulation steps and is superfluous in the current version of the tutorial. In earlier versions it was used as part of a condition of the 'while' loop. (see http://sumo-sim.org/trac.wsgi/browser/trunk/sumo/tests/complex/tutorial/traci_tls/runner.py?rev=14220 )
regards, Jakob 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
