You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
egueli edited this page Apr 16, 2013
·
3 revisions
Improving Simulation Speed with Multi-Queries
When dealing with a large-scale simulation, with hundreds or even thousands of vehicles and/or roads, it's important to take care of performance.
SUMO by itself is quite scalable, but when it is controlled via TraCI, the overhead associated to message exchange can cause a performance bottleneck, especially if each [http://sumo.sourceforge.net/doc/current/docs/userdoc/TraCI/Protocol.html#Messages](TraCI message) contains only one command. TraCI4J provides a way to group together a batch of commands, send them as a single message and get a single reply message with all the responses.
Here's how to do:
call SumoTraciConnection.makeMultiQuery() to get a MultiQuery instance;
add all the queries (e.g. Vehicle.queryReadPMXEmission()) to the MultiQuery, keeping a reference in your code;
call MultiQuery.run(), which will make the network request to SUMO;
in the referenced queries, call their get() method to retrieve the requested data.