Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] module 'sumolib.net' has no attribute 'getEdge'
  • From: <Maria.Armellini@xxxxxx>
  • Date: Fri, 26 Mar 2021 08:16:38 +0000
  • Accept-language: de-DE, en-US
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • Ironport-hdrordr: A9a23:c+i4RKzh08us1d8KgOYcKrPxSeskLtp033Aq2lEZdDV8eMaVjt 3rufwd2wP9hjp5YgBFpfmrPq6cTXTAsbt85ocMNbmvNTOW31eABodk8Ifk3nncCzTzn9Qtr5 tIXqBiBLTLbWRSot395GCDfuoI4N7Cy6ywgPeb8nEFd3AOV4hFzyNUTjmWCVd3Qg4uP+tFKL O56tBcrzStPVQ7B/7LZUUtZOTIq93VmJ+OW3dvbHQawTKDgj+y5LnxHwLw5GZ9bxp03bwg/W LZ+jaX2oyfsuq2whKZ92jf44U+orrc4+ZDH8CFh4wpLCztgG+TCrhJZrvqhlwIidDqzGxvsd HX5z88Isx46hrqDweIiCqo/zOl7REDxDvJz0SCjX7qvMrjLQhKcvZplMZeaRvW600podF63u ZKxguixuJqJAKFgSC4/d/UTVVxklesyEBS6tIusw==
  • Ironport-phdr: A9a23:zgF+VhSj71XZTzyUm9AUy0IOwNpsoiifAWYlgqEPu/d1aq2muq7aF wnh351FslbFUM3h5u5ejKKO6ua8AD1GuMvY+y5fOLV3FDY9wf0MmAIhBMPXQWbaF9XNKxIAI cJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3OgV6PPn6FZDPhMqrye+y54fTYwJVjzahfL9+N hq7oRjVu8UMnIdvKrs9xhTIr3ZIZu9b2X5mKVWPkhjm+8y+5oRj8yNeu/Ig885PT6D3dLkmQ LJbETorLXk76NXkuhffQwSP4GAcUngNnRpTHwfF9hD6UYzvvSb8q+FwxTOVPczyTbAzRDSi8 6JmQwLmhSsbKzI09nzch8pth6xZvR2hvQRyzY7Kbo+IKPpwcKDTfd0YSmpAQ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F9bGPeMu0dg==
  • 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>
  • Thread-index: AQHXIf0Ai0rF8VYukU+OFhxFzxDYN6qV62EQ
  • Thread-topic: module 'sumolib.net' has no attribute 'getEdge'

Hi,

 

I think the error is that you are not calling your net (“network” in your example), but the general net element from sumolib:

 

network= sumolib.net.readNet('RL.net.xml', withInternal=True)

edges= network.getEdge('6098').getToNode().getID()

 

Here your code with the changes

 

import os, sys

import sumolib

from sumolib import net (not needed)

 

if 'SUMO_HOME' not in os.environ:

     SUMO_HOME=os.path.join(os.sep, 'home','sumo')

     sys.path.append('SUMO_HOME')

 

tools = os.path.join(os.environ['SUMO_HOME'], 'tools')

sys.path.append(tools)

 

 

from sumolib import checkBinary

sumoBinary = checkBinary('sumo')

sumoBinaryGUI = checkBinary('sumo-gui')

 

 

network= sumolib.net.readNet('RL.net.xml', withInternal=True)

edges= net.getEdge('6098').getToNode().getID()

edges= network.getEdge('6098').getToNode().getID()

 

print(edges)

 

 

 

Von: sumo-user <sumo-user-bounces@xxxxxxxxxxx> Im Auftrag von Mohammed Hammam
Gesendet: Freitag, 26. März 2021 06:07
An: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Betreff: [sumo-user] module 'sumolib.net' has no attribute 'getEdge'

 

Hi there,

 

I have a problem when I try to get any information from sumolib, I have checked the sumolib document and followed the steps but I keep getting this error

module 'sumolib.net' has no attribute 'getEdge'

its same for everything, lanes, nodes, etc

 

I changed my code several times, removed the 'get' word and when I try to call the code I have another error

'module' object is not callable

 

any suggestions?

 

here is my simple code example:

 

import os, sys

import sumolib

from sumolib import net

 

if 'SUMO_HOME' not in os.environ:

     SUMO_HOME=os.path.join(os.sep, 'home','sumo')

     sys.path.append('SUMO_HOME')

 

tools = os.path.join(os.environ['SUMO_HOME'], 'tools')

sys.path.append(tools)

 

 

from sumolib import checkBinary

sumoBinary = checkBinary('sumo')

sumoBinaryGUI = checkBinary('sumo-gui')

 

 

network= sumolib.net.readNet('RL.net.xml', withInternal=True)

edges= net.getEdge('6098').getToNode().getID()

print(edges)

 

my error appears here: net.getEdge('6098').getToNode().getID()

 

 

Best Regards,

 

Mohammed Hammam

Twitter    ​. Linkedin

Tel: +974-5563-3861


Back to the top