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 <namdre.s...@gmail.com> 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 <amini...@gmail.com>: >> >> 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 >> sumo-user@eclipse.org >> To unsubscribe from this list, visit >> https://www.eclipse.org/mailman/listinfo/sumo-user > > _______________________________________________ > sumo-user mailing list > sumo-user@eclipse.org > To unsubscribe from this list, visit > https://www.eclipse.org/mailman/listinfo/sumo-user _______________________________________________ sumo-user mailing list sumo-user@eclipse.org To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user