Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] libsumo & subscriptions
  • From: Michael Behrisch <oss@xxxxxxxxxxx>
  • Date: Fri, 22 Mar 2019 16:12:55 +0100
  • Autocrypt: addr=oss@xxxxxxxxxxx; prefer-encrypt=mutual; keydata= mQGiBFLSvucRBACGsasS4GeIWs1CFNTOYmp3ScQ2ZTJLJWQxhPliwtHTzLsErYu9Y7e8qDov iHFviYyaNuceUNoACm1e4MT4eu0DmM2Wk3y/jjD6hfm7L0EZNPxQhj+CJf2oZAm2ezCe7/si xZ2d7TCO8yWavOGbF0EVi/ZDIJqVgupu6WBpv/NCewCg65HQiS1wm+1w1MdFYxKCmXzbv08D /iWXX3tzabbCrLlUum8hBgBpJEHRtlic2uaGsKm8Fize4tfLZkTBbTYLYXfcx2Oq9+lINPTW h9jnbCjAjErRWLTjNTQjel0JnDryCnqabub/R3wScR/EHRDBeS9L6YRj0xdVd2qIaArtSYRR auKPNc4M2qZNEFSM37cXC7avhpdeA/99oJf4qyVly4RxHmekAmj9UJjRx17x9xX8t9uzUuSt AeTh+kQ3o5jK7veU6/F/+pPyi96EOzym9BJA8pgXC8hLWNjOajI10filkdQ26QsfHOpUdPSZ 4Duyw9Ayj8loagEnnAONmU/xE0QlyVBANIut0W+SNqPScYXfnBbVOaG3HbQiTWljaGFlbCBC ZWhyaXNjaCA8b3NzQGJlaHJpc2NoLmRlPohjBBMRAgAjBQJS0sHSAhsjBwsJCAcDAgEGFQgC CQoLBBYCAwECHgECF4AACgkQPBD+ltFwpimlmQCdGgnYuHxoye4vFntyHRcE0Ij0318AoN3s szGyKcKdUmPpgXLhFcNfRGe4uQENBFLSvucQBACRAt3OW7eL8N3OJp2bZz/rRldtxjcViEcd +wpQcL9Ag0b6W7e4cbSc9oSU9MAdOvxR0UxualeRGz37W/VEC8cFZb3kFtRdl66gGygKb7gl 2S27495XEYqE7BBF1HfQDjL9sh5GfuIzORkqhCHSUTdkRuzRPxNQcEYFSrASEi9jQwADBQP9 FeuTC1SJHrX9tP3p4xrEa07XkCq+UzwNhDdezoQfT1CUbOv+LT66yLTXAaiHXelgaPMQO1Oo 76U2z0C1LudkAcDdwJbMuZ0RfDoRjsgfhfvM6kqiP4m0s2NR3Y3O+HKXjwtPbXuDwaYIAIvp aj8b59n7fQyfL6BZsO0QZc0i/t+ISQQYEQIACQUCUtK+5wIbDAAKCRA8EP6W0XCmKY1lAKCc 3miJueOXuvZJWV7qGBQxxyR83gCgxhGPL9OrP22rxNJSo1w5OOUxHsM=
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/sumo-user>
  • List-help: <mailto:sumo-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=unsubscribe>
  • Openpgp: preference=signencrypt
  • User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

Hi Aleksander,
my thoughts on that one below:

Am 22.03.19 um 14:50 schrieb czechows:
> libsumo.vehicle.getSubscriptionResults() returns a SwigPy object

this won't be fixed soon, probably, since I first want to check how this
make reusable instead of copying the same code over and over again.

> libsumo.vehicle.getSubscriptionResults(vehID) returns a Python dictionary,
> but if one of the subscriptions is the vehicle position then it is again
> a SwigPy object and so on.

This one I would consider a bug and not an incomplete interface. I will
try to fix this till the next release in April.

> 1. My colleagues and I use a wrapper around SUMO, that was till now
> organized around obtaining all needed data from subscription and caching
> it, for faster execution time.
> We want to make it configurable to support both traci and libsumo.
> Is it on the development roadmap to complete the translation for libsumo
> subscriptions?
> If not, then we would rewrite our wrapper, but this would be unnecessary
> effort if the SUMO developers plan to fix it soon anyways.

But honestly, if you have bigger implementation efforts anyway and a
whole team working on this wouldn't it be an option to try and fix this
yourselves and contribute it back? I would be very grateful if you could
at least consider the idea and be willing to give support if I can.

> 2. Assuming support for libsumo subscriptions is not planned:would
> asking for each variable through libsumo be still faster than obtaining
> all of them (e.g. all vehicle positions in a simulation) through a traci
> subscription?

The subscription results are stored in a map of maps once the step is
finished so there should be no notable performance difference between
asking for each vehicle result separately or obtaining the whole map and
iterate over it (provided that python maps and C++ maps are more or less
equally performant). This is true for TraCI and libsumo. Asking for
every vehicle parameter individually (without subscriptions) will make a
major difference in TraCI (since it will do network communication for
every call) but probably not so much in libsumo.

> That probably would also depend on the number of vehicles?

The version without subscriptions definitely, the other not so much.

Best regards,
Michael

Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top