Also, if you need different versions of the same network that just differ
in speeds, consider
https://sumo.dlr.de/docs/Simulation/Variable_Speed_Signs.html

Am Di., 20. Dez. 2022 um 12:01 Uhr schrieb Jakob Erdmann <
[email protected]>:

> If you apply a patch file with edge speeds (and no other edge attributes)
> to an existing .net.xml file then it should not affect any geometries
> (assuming the original network was created with the same netconvert
> version).  If you have a counter example, please open an issue on github.
> Caveat: there actually might be minor changes if the original .net.xml
> came directly from an osm import because the projected coordinates use more
> digits than the .net.xml. However, if you already did manual changes (which
> implies writing and loading one more time) than you should be fine.
>
> Am Di., 20. Dez. 2022 um 10:49 Uhr schrieb Sasan Amini <[email protected]
> >:
>
>> there is a "problem" with this approach, namely rerunning netconvert.
>> This may affect some geometries or attributes that are already
>> (manually) changed. I was thinking of something like this:
>> def modifySumoNetSpeed(network_path:str,selected_lanes:list,newSpeed:str):
>>     tree = ET.parse(network_path)
>>     root = tree.getroot()
>>     for edge in root.iter('edge'):
>>         for lane in edge.iter('lane'):
>>             if lane.get('id') in selected_lanes:
>>                 lane.set('speed', newSpeed)
>>     tree.write('output.net.xml')
>>     return True
>>
>> On Fri, Dec 16, 2022 at 5:06 PM Jakob Erdmann <[email protected]>
>> wrote:
>> >
>> > see
>> https://sumo.dlr.de/docs/Tutorials/ScenarioGuide.html#modifying_node_positions_with_the_help_of_sumolib
>> >
>> > Am Fr., 16. Dez. 2022 um 14:24 Uhr schrieb Sasan Amini <
>> [email protected]>:
>> >>
>> >> Dear all,
>> >>
>> >> is there an option to change some of the network attributes using
>> >> sumolib and save the new network? I think currently the option is not
>> >> supported and not sure how difficult would it be to implement that.
>> >> e.g. to change the speed limit or allowed vehicle classes to have
>> >> multiple versions of a base network.
>> >> I know parsing the XML using xmltree could work, but I think changing
>> >> attributes directly in the xml is not the best (error free) way.
>> >>
>> >> Thanks
>> >> Sasan
>> >> _______________________________________________
>> >> sumo-user mailing list
>> >> [email protected]
>> >> To unsubscribe from this list, visit
>> https://www.eclipse.org/mailman/listinfo/sumo-user
>> >
>> > _______________________________________________
>> > sumo-user mailing list
>> > [email protected]
>> > To unsubscribe from this list, visit
>> https://www.eclipse.org/mailman/listinfo/sumo-user
>> _______________________________________________
>> sumo-user mailing list
>> [email protected]
>> To unsubscribe from this list, visit
>> https://www.eclipse.org/mailman/listinfo/sumo-user
>>
>
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to