Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Modifying the SUMO network at runtime

Hi Jakob,

I have implemented your suggestion to use SUMO's save and reload process to account for network modifications at runtime. It mostly works, but I'm seeing issues when I add new edges and lanes into the network in between the save and reload. In that case, my vehicles don't restart on the lanes I expect them to.

(For a little background, I have built a process to create new edges and lanes inside water polygons, so I can simulate boats moving around in a lake or ocean without relying on waterways from OSM. So I import an OSM map to create an initial network, launch SUMO on it, then kick off my water-network builder which process XML node and edge files, which I merge into the original network using netconvert. This process adds new edges and lanes based on the water mesh it built. I hope to use the save and reload to pickup these new water edges without completely restarting my simulation).

When I look in the save-state XML file, SUMO is saving out actual lane IDs, but when I look at the reload code (MSStateHandler.cpp, method myStartElement, case SUMO_TAG_LANE), it seems to rely on the index of the edges and lanes being the same as they were when the file was written. If any edges or lanes get added to the network after save, things get out of order.

Would it be possible to use the edge and lane IDs directly to look up those items instead of relying on indexes? Then the reload process would be more resilient and could better handle added/reordered/deleted edges and lanes. I'm about to experiment with that change but wanted to see if there were any gotchas.

Thanks
Linwood


Date: Tue, 5 Mar 2019 23:02:09 +0100
From: Jakob Erdmann <namdre.sumo@xxxxxxxxx>
To: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Subject: Re: [sumo-user] Modifying the SUMO network at runtime
Message-ID:
        <CAMbUcbxp63qy9pFnBYvmxY2b+qE55XwtdJsx_FqUznYZsM94Hw@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

Hello,
there is currently no support for modifying the network except for changing
lane permissions.
Adding nodes and edges at runtime would be quite difficult since you would
have to replicate all the procesing steps of netconvert (e.g. to compute
intersection rules) as wells as all the steps that are done by the
simulation when loading a network (some of them interdependent and to be
done in the right order).
Modifying elevation at runtime would probable be doable since this part of
the network data has no interdependencies with other structures and you
could borrow code from traci.polygon.setShape.

An alternative might be to save the simulation state (--save-state) and
then restart the simulation with a modified but compatible network and the
saved state.

regards,
Jakob



Am Di., 5. M?rz 2019 um 17:07 Uhr schrieb Linwood Hudson <vtkougrr@xxxxxxxxx
>:

> Hello all,
>
> My project performs several pre-processing steps to OSM files prior to
> running them through netconvert and launching SUMO. The most time-consuming
> is using Osmosis to apply elevation data to each node, as is required for
> my simulation purposes. I'm looking into ways to speed up the
> initialization of my SUMO simulation and potentially deferring expensive
> operations. All of these expensive operations involved modifying the
> network structure in some way (e.g. applying elevation data to nodes,
> adding additional nodes/edges in places that don't have good coverage in
> OSM, etc.).
>
> I would like to load a base OSM immediately to get my simulation running,
> then layer in elevation data and more refined nodes/edges later when the
> longer-running processes complete. There doesn't appear to be any support
> for modifying the network at runtime using TRACI. At a minimum just editing
> the elevation values of nodes, but potentially adding new nodes and lanes.
> Are there major technical challenges to editing the network at runtime?
> Even just changing the elevation values?
>
> If there are any options I could consider please let me know.
>
> Thanks!
> _______________________________________________
> sumo-user mailing list
sumo-user@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.eclipse.org/mailman/private/sumo-user/attachments/20190305/65249473/attachment.html>  

Back to the top