Hello,
simulationStep(0) is indeed a special case:
when you first start your simulation
getCurrentTime() returns 0, yet when you call simulationStep(0) it advances
and thus getCurrentTime() returns 500.

When you next call simulationStep(500) the simulation does not advance any
further and getCurrentTime() remains at 500 (as per the wiki documentation)

This reflects exactly what you already stated in your first email.
However, what I tried to explain in my last mail is that after the very
first call to simulationStep nothing except the initial vehicle insertions
has taken place.
So the very first call to simulationStep will give you the information
regarding insertions without any vehicle having moved.

regards,
Jakob



2017-09-27 22:42 GMT+02:00 Mani Amoozadeh <[email protected]>:

> Thanks Jakob, but I am more confused now.
>
> Consider these two cases:
>
>
>
> *Case 1:* When I call SimulationStep starting from 0:
>
>
>
> - SimulationStep (0) --> advance simulation to the end of step 0 and
> simulationGetTime is now 500ms
>
> - SimulationStep (500) --> advance simulation to the end of step 500ms and
> simulationGetTime is now 1000ms.
>
> and so on…
>
>
>
> *Case 2:* Now, consider the case that I call SimulationStep starting from
> 500ms:
>
>
>
> - SimulationStep (500) --> advance simulation to the end of step 500, but
> simulationGetTime still shows 500ms
>
> - SimulationStep (1000) --> advance simulation to the end of step 1000ms,
> but simulationGetTime still shows 1000ms.
>
> and so on…
>
>
>
> Moreover, I can explain case 1 with the WiKi:
>
>
>
>
>
> In case 1, calling SimulationStep (500) should not advance the SUMO
> simulation cause the target time is smaller or equal to the current
> simulation step. right?
>
>
>
>
>
> - Mani
>
>
>
>
>
>
>
> *From:* Jakob Erdmann [mailto:[email protected]]
> *Sent:* Tuesday, September 26, 2017 3:16 AM
> *To:* Mani Amoozadeh <[email protected]>; Sumo project User
> discussions <[email protected]>
> *Cc:* sumo-user <[email protected]>
> *Subject:* Re: [sumo-user] Simulation Step TraCI call at time 0
>
>
>
> Hello,
>
> when you take a look at the gui, you will find that the first call of
>
> simulationStep(0) advances the simulation to the end of step 0 (with
> vehicles departing at 0 already being inserted).
>
> Only the command simulation.getCurrentTime() already shows you 0.5 because
> all further traci calls will be processed at the start of the step that
> ends at 0.5
>
> However, any vehicle positions you retrieve after the first call to
> simulationStep will be the ones from the insertion step 0.
>
> regards,
>
> Jakob
>
>
>
> 2017-09-26 10:35 GMT+02:00 Mani Amoozadeh via sumo-user <
> [email protected]>:
>
> Hello,
>
>
>
> I setup a SUMO simulation with 0.5s time step in TraCI mode.
>
> Once the TraCI is established I subscribe to departed vehicles count and
> then insert 10 vehicles at time 0s.
>
> I call simulation step like this:
>
>
>
> simulationStep(500) --> simulationStep(1000) --> simulationStep(1500) .
>
>
>
> The first simulationStep returns subscription result that all 10 vehicles
> have departed.
>
>
>
> Is there any way to call simulationStep like this:
>
>
>
> simulationStep(0)  --> simulationStep(500) --> simulationStep(1000) -->
> simulationStep(1500) .
>
>
>
> So that the first simulationStep call give me the subscription result
> showing that all vehicles have departed.
>
> Apparently, I cannot do this since 0 has a special meaning and proceeds
> simulation to 500ms.
>
> Is there any workaround for this?
>
>
>
> Thank you.
>
>
>
> - Mani
>
> ------------------------------------------------------------
> ------------------
> 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
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/sumo-user
>
>
>
_______________________________________________
sumo-user mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user

Reply via email to