Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Libsumo for python
  • From: Michael Behrisch <oss@xxxxxxxxxxx>
  • Date: Fri, 5 Oct 2018 23:02:18 +0200
  • Autocrypt: addr=oss@xxxxxxxxxxx; prefer-encrypt=mutual; keydata= xsDiBFLSvucRBACGsasS4GeIWs1CFNTOYmp3ScQ2ZTJLJWQxhPliwtHTzLsErYu9Y7e8qDov iHFviYyaNuceUNoACm1e4MT4eu0DmM2Wk3y/jjD6hfm7L0EZNPxQhj+CJf2oZAm2ezCe7/si xZ2d7TCO8yWavOGbF0EVi/ZDIJqVgupu6WBpv/NCewCg65HQiS1wm+1w1MdFYxKCmXzbv08D /iWXX3tzabbCrLlUum8hBgBpJEHRtlic2uaGsKm8Fize4tfLZkTBbTYLYXfcx2Oq9+lINPTW h9jnbCjAjErRWLTjNTQjel0JnDryCnqabub/R3wScR/EHRDBeS9L6YRj0xdVd2qIaArtSYRR auKPNc4M2qZNEFSM37cXC7avhpdeA/99oJf4qyVly4RxHmekAmj9UJjRx17x9xX8t9uzUuSt AeTh+kQ3o5jK7veU6/F/+pPyi96EOzym9BJA8pgXC8hLWNjOajI10filkdQ26QsfHOpUdPSZ 4Duyw9Ayj8loagEnnAONmU/xE0QlyVBANIut0W+SNqPScYXfnBbVOaG3Hc0mTWljaGFlbCBC ZWhyaXNjaCA8bWljaGFlbEBiZWhyaXNjaC5kZT7CZgQTEQIAJgIbIwcLCQgHAwIBBhUIAgkK CwQWAgMBAh4BAheABQJS0sKXAhkBAAoJEDwQ/pbRcKYp+SEAoMJSvUzfk3u6EA1nMlMVSk85 nHhoAJ0VE5xLi2ni8j9wdx+uga7XGLtjhs7ATQRS0r7nEAQAkQLdzlu3i/Ddziadm2c/60ZX bcY3FYhHHfsKUHC/QING+lu3uHG0nPaElPTAHTr8UdFMbmpXkRs9+1v1RAvHBWW95BbUXZeu oBsoCm+4Jdktu+PeVxGKhOwQRdR30A4y/bIeRn7iMzkZKoQh0lE3ZEbs0T8TUHBGBUqwEhIv Y0MAAwUD/RXrkwtUiR61/bT96eMaxGtO15AqvlM8DYQ3Xs6EH09QlGzr/i0+usi01wGoh13p YGjzEDtTqO+lNs9AtS7nZAHA3cCWzLmdEXw6EY7IH4X7zOpKoj+JtLNjUd2Nzvhyl48LT217 g8GmCACL6Wo/G+fZ+30Mny+gWbDtEGXNIv7fwkkEGBECAAkFAlLSvucCGwwACgkQPBD+ltFw pimNZQCgnN5oibnjl7r2SVle6hgUMcckfN4AoMYRjy/Tqz9tq8TSUqNcOTjlMR7D
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • List-archive: <https://dev.eclipse.org/mailman/private/sumo-user>
  • List-help: <mailto:sumo-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://dev.eclipse.org/mailman/listinfo/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://dev.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.0

Hi Didac,
the translation of the C++ to the Python object is still incomplete, but
if you retrieve the results one by one (using something like
libsumo.lanearea.getSubscriptionResults(one_area)) you should get a
normal python dict as result.

Best regards,
Michael

Am 05.10.18 um 13:09 schrieb Didac Busquets:
> Hi Michael,
> 
> I recompiled everything and now it works.
> 
> I now have another question. I'm using libsumo and subscriptions, and have some code similar to this:
> 
> libsumo.lanearea.subscribe(one_area, (libsumo.constants.LAST_STEP_OCCUPANCY,libsumo.constants.JAM_LENGTH_METERS))
> ...
> result = libsumo.lanearea.getAllSubscriptionResults()
> 
> The type of result is SwigPyObject. How should I handle it to get the results of subscriptions?
> 
> Thanks,
> 
> 	Didac
> 
> 
> -----Original Message-----
> From: Michael Behrisch <oss@xxxxxxxxxxx> 
> Sent: 27 September 2018 22:21
> To: Sumo project User discussions <sumo-user@xxxxxxxxxxx>; Didac Busquets <didac.busquets@xxxxxxxxxx>
> Subject: Re: [sumo-user] Libsumo for python
> 
> Hi Didac,
> it should not be necessary to have tools/libsumo in the python path.
> Where does SUMO_HOME point to?
> 
> Best regards,
> Michael
> 
> Am 25.09.18 um 15:39 schrieb Didac Busquets:
>> Hi,
>>
>>  
>>
>> I've compiled v1.0.1 and when trying to use the python libsumo I get 
>> this error:
>>
>>  
>>
>> $ python
>>
>> Python 3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 
>> 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
>>
>> Type "help", "copyright", "credits" or "license" for more information.
>>
>>>>> import libsumo
>>
>> Traceback (most recent call last):
>>
>>   File "<stdin>", line 1, in <module>
>>
>>   File "C:\Program Files
>> (x86)\DLR\sumo-1.0.1\tools\libsumo\__init__.py", line 15, in <module>
>>
>>     from .libsumo import *  # noqa
>>
>>   File "C:\Program Files 
>> (x86)\DLR\sumo-1.0.1\tools\libsumo\libsumo.py",
>> line 5896, in <module>
>>
>>     vehicle.addLegacy =
>> wrapAsClassMethod(_vehicle.VehicleDomain.addLegacy, vehicle)
>>
>> AttributeError: type object 'VehicleDomain' has no attribute 'addLegacy'
>>
>>  
>>
>> I've added both the tools and tools/libsumo in the PYTHONPATH env variable.
>>
>>  
>>
>> However, if I run it from the tools folder, libsumo loads correctly.
>>
>>  
>>
>> Am I missing something?
>>
>>  
>>
>> Thanks,
>>
>>  
>>
>>                Didac
>>
>>  
>>
>> Immense Simulations Limited <https://htmlsig.com/t/000001D1FAJA>
>>
>> https://s3.amazonaws.com/htmlsig-assets/spacer.gif
>>
>> Twitter
>> <https://htmlsig.com/t/000001DMCGQH>https://s3.amazonaws.com/htmlsig-a
>> ssets/spacer.gifFacebook 
>> <https://htmlsig.com/t/000001DRXRE6>https://s3.amazonaws.com/htmlsig-a
>> ssets/spacer.gifLinkedIn 
>> <https://htmlsig.com/t/000001CVTDTW>https://s3.amazonaws.com/htmlsig-a
>> ssets/spacer.gif
>>
>> https://s3.amazonaws.com/htmlsig-assets/spacer.gif
>>
>> 	
>>
>> https://s3.amazonaws.com/htmlsig-assets/spacer.gif
>>
>> 	
>>
>> https://s3.amazonaws.com/htmlsig-assets/spacer.gif
>>
>> 	
>>
>> *Didac Busquets*/ Co-Founder and Chief Scientist 
>> didac.busquets@xxxxxxxxxx <mailto:didac.busquets@xxxxxxxxxx> / +44 (0)
>> 7919 076 981
>>
>> https://s3.amazonaws.com/htmlsig-assets/spacer.gif
>>
>> *Immense Simulations Limited*
>> Studio J2, Witan Studios, 279 Witan Gate, Central Milton Keynes, MK9 
>> 1EJ
>> *w3w*: ourselves.depend.backpack
>> <:%20https:/map.what3words.com/ourselves.depend.backpack>
>> www.immense.ai <https://www.immense.ai/>
>>
>> https://s3.amazonaws.com/htmlsig-assets/spacer.gif
>>
>> https://s3.amazonaws.com/htmlsig-assets/spacer.gif
>>
>> This e-mail including any attachments is intended for the addressee 
>> only. It is private, confidential and may be covered by legal 
>> professional privilege. If you have received this message in error 
>> please notify us immediately and remove it from your system. Immense 
>> Simulations Limited is a Company registered in England and Wales No.
>> 09782647. Registered offices: International House, 24 Holborn Viaduct, 
>> City Of London, London, England, EC1A 2BN.
>>
>>  
>>
>>
>> _______________________________________________
>> 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
>>
> 
> 


Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top