Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-dev] Appropriate way of creating junctions in a network importer

These connections are removed during the NBNetBuilder::compute() steps.
before that sorting function comes up (vial NBEdgeCont::sortOutoingLanesConnections),
the function NBEdgeCont::computeLanes2Edges() is called. In that function
the method NBEdge::getConnectedSorted filters out the toEdge=0 connections.
This handles the case where an edge has no connections at all (which is somewhat rare).
However, if only some edge-to-edge relations are forbidden then the remaining connections
with fromLane=-1 are filtered out in NBEdge::divideOnEdges.

In short: if you are run standard NBNetBuilder::compute and do not call the sorting function beforehand, it should work.

I think our tests cover all these cases but If you have a counter-example that triggers the mentioned assertion with plain-xml input (.nod.xml, .edg.xml, .con.xml) then please send it to me.

regards,
Jakob



2018-06-23 15:30 GMT+02:00 Mirko Barthauer <m.barthauer@xxxxxxxxxxx>:

Hi Jakob,

so I was right using addEdge2EdgeConnection(0). This leads me to the following debug assertion error:

"invalid operator<" (at NBEdge::sortOutgoingConnectionsByAngle())

To me it looks as if the sort function does not work together with the dummy Connection struct created when calling addEdge2EdgeConnection(0):

myConnections.push_back(Connection(-1, dest, -1));

When I comment out the line above, everything works well. Is there something I'm still missing?

Regars
Mirko




Am 22.06.2018 um 23:16 schrieb Jakob Erdmann:
Hello,
as soon as you declare at least 1 connection for an edge, no further connections will be guessed.
Declaring an edge to be without connections should work by calling addEdge2EdgeConnection(0). This is how
NIXMLConnectionsHandler does it (The flag that prevents guessing in this case is INIT_REJECT_CONNECTIONS).
You should declare your connections using
edge->addLane2LaneConnection(fromLane, to, toLane, NBEdge::L2L_USER, true, mayDefinitelyPass, keepClear, contPos, visibility, speed, customShape))
The assumption is, that the import process is finished before entering NBNetBuilder::compute()

regards,
Jakob

2018-06-22 19:00 GMT+02:00 Mirko Barthauer <m.barthauer@xxxxxxxxxxx>:

Hi SUMO developers,

I have run into some problems with my netconvert extension. Following the instructions at http://sumo.dlr.de/wiki/Developer/How_To/Net_Importer , I have created the NBNode and NBEdge instances from my input format. Afterwards, I'd like to add connections to the junctions. It seems to me they already get created automatically together with the edges.

My question is: How can I add those connections I want (providing a custom shape, too) and leave out the others? And how do these steps like "INIT_REJECT_CONNECTIONS" interfere with the import process?

 Firstly, I used NBEdge::addEdge2EdgeConnection(0) to remove connections, but somehow netconvert didn't like the dummy Connection struct created in this method. What is the advised way here?

Regards
Mirko


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




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


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



Back to the top