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 <[email protected]> Im Auftrag von Mohammed Hammam
Gesendet: Freitag, 26. März 2021 06:07
An: Sumo project User discussions <[email protected]>
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
Facebook<https://www.facebook.com/BoWa3d> |
Instagram<https://www.instagram.com/waed1110/>
Twitter<https://twitter.com/waed1110> . |
Linkedin<https://www.linkedin.com/in/mohammedhammam-aboshaban-802b30155/>
Tel: +974-5563-3861
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user