Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Loaded vs Departed Vehicles

the function simulation.getLoadedNumber and getLoadedIDList only refer to vehicles that were loaded in the last time step (usually vehicles are loaded in chunks of about 200s (configurable using option --route-steps).
This means some of the loaded vehicles are schedulare to depart in the future but they are already known to the simulation. They exist in the simulation until their arrival.
You can query some variables only for vehicles that have departed (e.g. getSpeed() but some things like getTypeID() are possible for loaded vehicles that have not yet departed)
getDepartedIDs only returns vehicles that have just departed in the last steop and not those that have departed further in the past.

2018-07-20 23:54 GMT+02:00 Jakob Erdmann <namdre.sumo@xxxxxxxxx>:
Hello,
you are not supposed to instantiate Domains because they require additional initialization.
Instead, use
traci.vehicle.getSubscriptionResults()
Don't worry if your IDE fails to recognize traci.vehicle.
regards,
Jakob

2018-07-20 14:09 GMT+02:00 cchadj01--- via sumo-user <sumo-user@lists.sourceforge.net>:

Hello,
 I would like to ask what exactly are loaded vehicles?
 From my understanding loaded vehicles are vehicles that exist in the simulation until it ends.
 Can I subscribe to a loaded vehicle that has yet to be departed?
 In getDepartedIds do I get the ids of vehicles that have just entered the simulation (just started their jurney) or I also get vehicles that already existed from previous steps?

 Also in python I use getSubscriptionResults() but it doesn't return me a dict like it says in the python
 docs.
 (example on how I use it)
 import traci

 traci.start(sumoCmd, numRetries=2, port=2500 ,label="default")
 vehicleCommands = traci._vehicle.VehicleDomain()
 vehicleCommands._connection  = traci.getConnection(label="default")

 ...
 vehDict = vehicleCommands.getSubscriptionResults(vehId)
 ^ this is not a dictionary as it says in the docs.

Thank you!

------------------------------------------------------------------------------
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
sumo-user@xxxxxxxxxxxxxxxxxxxxt
https://lists.sourceforge.net/lists/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user



Back to the top