Hello,

I have found a way to use the patch files and to alter them by seeing the runner.py found here https://github.com/eclipse/sumo/blob/master/tests/tools/sumolib/patch_network/runner.py . I still don't quite grasp how I can read the existing python documentation.

Moving on, I manage to change a networks Nodes (a.k.a Junctions) coordinates. What still perplexes me is what are the hidden pseudo nodes that can be seen in the edge in neteditor. When I select them I can't get information about them. They look like nodes but I can't select them. Are they just simple coordinates that give the shape of the edge? If so can I alter them by altering the shape in .edg.xml files? Are they the same as the shape of child lane of the edge in .net.xml?

 Attached you can find an image of the said pseudonodes.

Thank you,
Tom
Quoting cchad...@cs.ucy.ac.cy:

Hello again,

I understood what plain-xml. It is the editable version of the network that consists of nod.xml, edg.xml, con.xml typ.xml. I also have found out from the examples in the site that you can access those files like so:

for edge in sumolib.output.parse('out.edg.xml', ['edge'], warn=True):
    speedSum += float(edge.speed)
    print(edge.attr_from)

What I don't understand is why is parse() in the sumolib output object? In the documentation found here http://sumo.dlr.de/daily/pydoc/sumolib.html it says that you can access this function directly from sumolib object.

What I also don't understand is how can I alter the plain xml? (How can I create new patch files and how to alter existing ones).

 Am I reading the documentation wrong or is it written wrongly ?

Thank you,
Tom



Quoting cchad...@cs.ucy.ac.cy:

Hello,

Could you please tell me what do you mean by converting the network to plain-xml? Isn't net.xml plain-xml? I can not find sufficient documentation for sumolib.xml.parse.

In addition how could I use said patch files in an existing network?

Thank you for your help,
Tom

Quoting cchad...@cs.ucy.ac.cy:

Hello,

Thank you for for the prompt reply.
I have searched into sumolib.xml.parse but I can't see how I can use it as I can't find any documentation. I have also tried sumolib but I can not see how I can change a node's position.

Thank you,
Tom

Quoting Jakob Erdmann <namdre.s...@gmail.com>:

Hello,
The only supported way to create networks is via netconvert. For
programmatic modifications you can either:
a)   - convert the network to plain-xml
   - modify those (sumolib.xml.parse can help with that. It creates
objects that allow attribute access and which can write themselves back out
as xml)
   - re-assemble into .net.xml with netconvert

b) generate patch files and patch the .net.xml using netconvert (patch
files are like plain-xml files but you only need to set those attributes
you wish to change)

- you can read the network graph using function sumolib.readNet (
http://sumo.dlr.de/wiki/Tools/Sumolib)
- you can modify the network while the simulation is running by changing
lane permission (If you add forbidden edges beforehand you can activate
them at runtime and vice versa)

regards,
Jakob


Am Mi., 30. Jan. 2019 um 20:17 Uhr schrieb <cchad...@cs.ucy.ac.cy>:

Hello,

I was wondering if I can have any programmatic access to netedit so
I can change my network from code or any other way I can change a road
network from code for that matter.
I wouldn't want to reinvent the wheel by creating an xml parser and
editor.

Thank you,
Tom




_______________________________________________
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user



_______________________________________________
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


_______________________________________________
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


_______________________________________________
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


_______________________________________________
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to