From c6dd8663b9716771efe86ca5442a5eaa9a17d2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Schweppenh=C3=A4user?= Date: Fri, 17 Jan 2025 11:37:28 +0100 Subject: [PATCH 001/116] fix(netdiff): Properly store generated shapes as additional files * this makes loading in netedit easier, as the file filter doesn't need to be adjusted --- src/netedit/tools/GNENetDiffTool.cpp | 6 +++--- tests/tools/config.tools | 6 +++--- tools/net/netdiff.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/netedit/tools/GNENetDiffTool.cpp b/src/netedit/tools/GNENetDiffTool.cpp index 6a2b0124b661..dda5db118492 100644 --- a/src/netedit/tools/GNENetDiffTool.cpp +++ b/src/netedit/tools/GNENetDiffTool.cpp @@ -75,13 +75,13 @@ GNENetDiffTool::postProcessing() { } // load shapes if (myPythonToolsOptions.getBool("load-shapes-modified")) { - loadShapes(myPythonToolsOptions.getString("outprefix") + ".changed.shape.xml"); + loadShapes(myPythonToolsOptions.getString("outprefix") + ".changed.shape.add.xml"); } if (myPythonToolsOptions.getBool("load-shapes-added")) { - loadShapes(myPythonToolsOptions.getString("outprefix") + ".created.shape.xml"); + loadShapes(myPythonToolsOptions.getString("outprefix") + ".created.shape.add.xml"); } if (myPythonToolsOptions.getBool("load-shapes-deleted")) { - loadShapes(myPythonToolsOptions.getString("outprefix") + ".deleted.shape.xml"); + loadShapes(myPythonToolsOptions.getString("outprefix") + ".deleted.shape.add.xml"); } } } diff --git a/tests/tools/config.tools b/tests/tools/config.tools index 1f975dfc21ae..2cf0272aced4 100644 --- a/tests/tools/config.tools +++ b/tests/tools/config.tools @@ -135,9 +135,9 @@ diff_xml:diff.xml created_sel:diff.created.sel.txt deleted_sel:diff.deleted.sel.txt changed_sel:diff.changed.sel.txt -created_shapes:diff.created.shape.xml -deleted_shapes:diff.deleted.shape.xml -changed_shapes:diff.changed.shape.xml +created_shapes:diff.created.shape.add.xml +deleted_shapes:diff.deleted.shape.add.xml +changed_shapes:diff.changed.shape.add.xml omnet:omnet.xml shawn:shawn.xml dri:test.dri diff --git a/tools/net/netdiff.py b/tools/net/netdiff.py index cf8a55d1a0ad..630b7bb70b94 100755 --- a/tools/net/netdiff.py +++ b/tools/net/netdiff.py @@ -675,9 +675,9 @@ def main(options): selectionOutputFiles.append(codecs.open(options.outprefix + '.deleted.sel.txt', 'w', 'utf-8')) selectionOutputFiles.append(codecs.open(options.outprefix + '.changed.sel.txt', 'w', 'utf-8')) if options.write_shapes: - shapeOutputFiles.append(codecs.open(options.outprefix + '.created.shape.xml', 'w', 'utf-8')) - shapeOutputFiles.append(codecs.open(options.outprefix + '.deleted.shape.xml', 'w', 'utf-8')) - shapeOutputFiles.append(codecs.open(options.outprefix + '.changed.shape.xml', 'w', 'utf-8')) + shapeOutputFiles.append(codecs.open(options.outprefix + '.created.shape.add.xml', 'w', 'utf-8')) + shapeOutputFiles.append(codecs.open(options.outprefix + '.deleted.shape.add.xml', 'w', 'utf-8')) + shapeOutputFiles.append(codecs.open(options.outprefix + '.changed.shape.add.xml', 'w', 'utf-8')) for f in shapeOutputFiles: sumolib.writeXMLHeader(f, "$Id$", "additional", options=options) # noqa From c18573ce8087940921e82bbb9c58a120502fbfea Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Fri, 17 Jan 2025 11:43:27 +0100 Subject: [PATCH 002/116] added tests refs #21, #16038 --- .../remove_explicit/districts.tools | 29 +++++++++++++++++++ .../remove_explicit/errors.tools | 0 .../remove_explicit/options.tools | 4 +++ .../remove_explicit/output.tools | 0 .../remove_explicit_file/data.txt | 1 + .../remove_explicit_file/districts.tools | 29 +++++++++++++++++++ .../remove_explicit_file/errors.tools | 0 .../remove_explicit_file/options.tools | 4 +++ .../remove_explicit_file/output.tools | 0 .../district/filterDistricts/testsuite.tools | 6 ++++ 10 files changed, 73 insertions(+) create mode 100644 tests/tools/district/filterDistricts/remove_explicit/districts.tools create mode 100644 tests/tools/district/filterDistricts/remove_explicit/errors.tools create mode 100644 tests/tools/district/filterDistricts/remove_explicit/options.tools create mode 100644 tests/tools/district/filterDistricts/remove_explicit/output.tools create mode 100644 tests/tools/district/filterDistricts/remove_explicit_file/data.txt create mode 100644 tests/tools/district/filterDistricts/remove_explicit_file/districts.tools create mode 100644 tests/tools/district/filterDistricts/remove_explicit_file/errors.tools create mode 100644 tests/tools/district/filterDistricts/remove_explicit_file/options.tools create mode 100644 tests/tools/district/filterDistricts/remove_explicit_file/output.tools diff --git a/tests/tools/district/filterDistricts/remove_explicit/districts.tools b/tests/tools/district/filterDistricts/remove_explicit/districts.tools new file mode 100644 index 000000000000..b0f6955319d4 --- /dev/null +++ b/tests/tools/district/filterDistricts/remove_explicit/districts.tools @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tools/district/filterDistricts/remove_explicit/errors.tools b/tests/tools/district/filterDistricts/remove_explicit/errors.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/district/filterDistricts/remove_explicit/options.tools b/tests/tools/district/filterDistricts/remove_explicit/options.tools new file mode 100644 index 000000000000..3df14a839991 --- /dev/null +++ b/tests/tools/district/filterDistricts/remove_explicit/options.tools @@ -0,0 +1,4 @@ +-n net.net.xml --taz-file input_districts.xml +-o districts.xml +--remove-ids e +tools/district/filterDistricts.py diff --git a/tests/tools/district/filterDistricts/remove_explicit/output.tools b/tests/tools/district/filterDistricts/remove_explicit/output.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/district/filterDistricts/remove_explicit_file/data.txt b/tests/tools/district/filterDistricts/remove_explicit_file/data.txt new file mode 100644 index 000000000000..d905d9da82c9 --- /dev/null +++ b/tests/tools/district/filterDistricts/remove_explicit_file/data.txt @@ -0,0 +1 @@ +e diff --git a/tests/tools/district/filterDistricts/remove_explicit_file/districts.tools b/tests/tools/district/filterDistricts/remove_explicit_file/districts.tools new file mode 100644 index 000000000000..b0f6955319d4 --- /dev/null +++ b/tests/tools/district/filterDistricts/remove_explicit_file/districts.tools @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tools/district/filterDistricts/remove_explicit_file/errors.tools b/tests/tools/district/filterDistricts/remove_explicit_file/errors.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/district/filterDistricts/remove_explicit_file/options.tools b/tests/tools/district/filterDistricts/remove_explicit_file/options.tools new file mode 100644 index 000000000000..d62e02934b4c --- /dev/null +++ b/tests/tools/district/filterDistricts/remove_explicit_file/options.tools @@ -0,0 +1,4 @@ +-n net.net.xml --taz-file input_districts.xml +-o districts.xml +--remove-ids-file data.txt +tools/district/filterDistricts.py diff --git a/tests/tools/district/filterDistricts/remove_explicit_file/output.tools b/tests/tools/district/filterDistricts/remove_explicit_file/output.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/district/filterDistricts/testsuite.tools b/tests/tools/district/filterDistricts/testsuite.tools index 1e5972eeebbd..0e3752d588e3 100644 --- a/tests/tools/district/filterDistricts/testsuite.tools +++ b/tests/tools/district/filterDistricts/testsuite.tools @@ -1,2 +1,8 @@ keep_all passenger + +# set edge ids to remove from all taz +remove_explicit + +# set edge ids to remove from all taz +remove_explicit_file From 009667c3c2dde9d3dcaed1c50823df7d877ca14f Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Fri, 17 Jan 2025 11:43:40 +0100 Subject: [PATCH 003/116] fix #16038 --- tools/district/filterDistricts.py | 37 ++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/tools/district/filterDistricts.py b/tools/district/filterDistricts.py index f7af449b8c31..cd9bf824acb5 100755 --- a/tools/district/filterDistricts.py +++ b/tools/district/filterDistricts.py @@ -17,7 +17,11 @@ # @date 2017-10-05 """ -Filters a TAZ file for a specific vehicle class +Filters a TAZ file for edges that exist in the given net +and optionally +- keep edges that permit a specific vehicle class +- remove specific edge ids + """ from __future__ import absolute_import from __future__ import print_function @@ -41,15 +45,34 @@ def getOptions(): required=True, help="the district file to be filtered") ap.add_argument("-o", "--output", default="taz_filtered.add.xml", category="output", type=ArgumentParser.file, help="write filtered districts to FILE (default: %(default)s)", metavar="FILE") - ap.add_argument("--vclass", type=str, required=True, help="filter taz edges that allow the given vehicle class") + ap.add_argument("--vclass", type=str, help="filter taz edges that allow the given vehicle class") + ap.add_argument("--remove-ids", category="processing", dest="removeIDs", + help="Remove the given ids from all TAZ") + ap.add_argument("--remove-ids-file", dest="removeIDsFile", category="processing", type=ap.additional_file, + help="Remove ids listed in FILE from all TAZ") options = ap.parse_args() - if not options.netfile or not options.tazfile or not options.vclass: + if not options.netfile or not options.tazfile: ap.print_help() ap.exit( "Error! net-file, taz-file and vclass are mandatory") + + options.remove = set() + if options.removeIDs is not None: + options.remove.update(options.removeIDs.strip("'").split(',')) + if options.removeIDsFile is not None: + with open(options.removeIDsFile) as idf: + for line in idf: + options.remove.update(line.strip().split(',')) + return options +def keep(options, net, edge): + return (net.hasEdge(edge) + and (options.vclass is None or net.getEdge(edge).allows(options.vclass)) + and edge not in options.remove) + + if __name__ == "__main__": options = getOptions() if options.verbose: @@ -60,13 +83,11 @@ def getOptions(): for taz in sumolib.output.parse(options.tazfile, "taz"): if taz.edges is not None: taz.edges = " ".join( - [e for e in taz.edges.split() if - net.hasEdge(e) and net.getEdge(e).allows(options.vclass)]) + [e for e in taz.edges.split() if keep(options, net, e)]) deleteSources = [] if taz.tazSink is not None: - taz.tazSink = [s for s in taz.tazSink if net.hasEdge(s.id) and net.getEdge(s.id).allows(options.vclass)] + taz.tazSink = [s for s in taz.tazSink if keep(options, net, s.id)] if taz.tazSource is not None: - taz.tazSource = [s for s in taz.tazSource if net.hasEdge( - s.id) and net.getEdge(s.id).allows(options.vclass)] + taz.tazSource = [s for s in taz.tazSource if keep(options, net, s.id)] outf.write(taz.toXML(initialIndent=" " * 4)) outf.write("\n") From 7eebff083ffcc71ea558273054accbd78619e6d2 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Fri, 17 Jan 2025 14:22:38 +0100 Subject: [PATCH 004/116] added tests refs #21, #16041 --- .../route/countEdgeUsage/save_template/toolcfg.tools | 1 + tests/tools/route/countEdgeUsage/testsuite.tools | 5 ++++- tests/tools/route/countEdgeUsage/verbose/errors.tools | 0 tests/tools/route/countEdgeUsage/verbose/options.tools | 1 + tests/tools/route/countEdgeUsage/verbose/output.tools | 3 +++ tests/tools/route/countEdgeUsage/verbose/routes.tools | 10 ++++++++++ 6 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/tools/route/countEdgeUsage/verbose/errors.tools create mode 100644 tests/tools/route/countEdgeUsage/verbose/options.tools create mode 100644 tests/tools/route/countEdgeUsage/verbose/output.tools create mode 100644 tests/tools/route/countEdgeUsage/verbose/routes.tools diff --git a/tests/tools/route/countEdgeUsage/save_template/toolcfg.tools b/tests/tools/route/countEdgeUsage/save_template/toolcfg.tools index bd26a77b3fef..578354ae2dd1 100644 --- a/tests/tools/route/countEdgeUsage/save_template/toolcfg.tools +++ b/tests/tools/route/countEdgeUsage/save_template/toolcfg.tools @@ -11,5 +11,6 @@ + diff --git a/tests/tools/route/countEdgeUsage/testsuite.tools b/tests/tools/route/countEdgeUsage/testsuite.tools index d5e101c1d455..f38ca4115dc8 100644 --- a/tests/tools/route/countEdgeUsage/testsuite.tools +++ b/tests/tools/route/countEdgeUsage/testsuite.tools @@ -1,8 +1,11 @@ # Tests for /tools/countEdgeUsage.py basic +# Tests for /tools/countEdgeUsage.py +verbose + # load 2 input files -# +# two_inputs # additional geo poi output diff --git a/tests/tools/route/countEdgeUsage/verbose/errors.tools b/tests/tools/route/countEdgeUsage/verbose/errors.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/route/countEdgeUsage/verbose/options.tools b/tests/tools/route/countEdgeUsage/verbose/options.tools new file mode 100644 index 000000000000..d8692151302e --- /dev/null +++ b/tests/tools/route/countEdgeUsage/verbose/options.tools @@ -0,0 +1 @@ +-v routes.rou.xml --output-file out.rou.xml tools/countEdgeUsage.py diff --git a/tests/tools/route/countEdgeUsage/verbose/output.tools b/tests/tools/route/countEdgeUsage/verbose/output.tools new file mode 100644 index 000000000000..5a69f9e54527 --- /dev/null +++ b/tests/tools/route/countEdgeUsage/verbose/output.tools @@ -0,0 +1,3 @@ +Loaded 3 routes +departEdges: count 3, min 1.00 (a), max 1.00 (a), mean 1.00, Q1 1.00, median 1.00, Q3 1.00 +arrivalEdges: count 3, min 1.00 (d), max 1.00 (d), mean 1.00, Q1 1.00, median 1.00, Q3 1.00 diff --git a/tests/tools/route/countEdgeUsage/verbose/routes.tools b/tests/tools/route/countEdgeUsage/verbose/routes.tools new file mode 100644 index 000000000000..c32f42e5bf97 --- /dev/null +++ b/tests/tools/route/countEdgeUsage/verbose/routes.tools @@ -0,0 +1,10 @@ + + + + + + + + + + From cf20a72d70a23fa0df2eab2279b0733e940b1e60 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Fri, 17 Jan 2025 14:22:44 +0100 Subject: [PATCH 005/116] fix #16041 --- tools/countEdgeUsage.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/countEdgeUsage.py b/tools/countEdgeUsage.py index dcffe978709b..4a3c035cb3df 100755 --- a/tools/countEdgeUsage.py +++ b/tools/countEdgeUsage.py @@ -57,6 +57,8 @@ def parse_args(): help="parse net for geo locations of the edges") op.add_argument("-p", "--poi-file", category="processing", type=op.additional_file, help="write geo POIs") + op.add_argument("-v", "--verbose", action="store_true", default=False, + help="tell me what you are doing") op.add_argument("routefiles", nargs="+", category="input", type=op.route_file, help="Set one or more input route files") @@ -153,6 +155,9 @@ def writeInterval(outf, options, departCounts, arrivalCounts, intermediateCounts departStats.add(departCounts[e], e) for e in sorted(arrivalCounts.keys()): arrivalStats.add(arrivalCounts[e], e) + if options.verbose: + print("Loaded %s routes" % sum(departCounts.values())) + print(departStats) print(arrivalStats) if options.intermediate: From 8f7839f1e2379fde39fd5708604fa9ef487bed0c Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Fri, 17 Jan 2025 14:42:45 +0100 Subject: [PATCH 006/116] added tests refs #21, #16041 --- .../tools/route/countEdgeUsage/save_template/toolcfg.tools | 1 + tests/tools/route/countEdgeUsage/subpart_gap/errors.tools | 0 tests/tools/route/countEdgeUsage/subpart_gap/options.tools | 1 + tests/tools/route/countEdgeUsage/subpart_gap/output.tools | 3 +++ tests/tools/route/countEdgeUsage/subpart_gap/routes.tools | 6 ++++++ tests/tools/route/countEdgeUsage/testsuite.tools | 3 +++ 6 files changed, 14 insertions(+) create mode 100644 tests/tools/route/countEdgeUsage/subpart_gap/errors.tools create mode 100644 tests/tools/route/countEdgeUsage/subpart_gap/options.tools create mode 100644 tests/tools/route/countEdgeUsage/subpart_gap/output.tools create mode 100644 tests/tools/route/countEdgeUsage/subpart_gap/routes.tools diff --git a/tests/tools/route/countEdgeUsage/save_template/toolcfg.tools b/tests/tools/route/countEdgeUsage/save_template/toolcfg.tools index 578354ae2dd1..6ae1f21789ff 100644 --- a/tests/tools/route/countEdgeUsage/save_template/toolcfg.tools +++ b/tests/tools/route/countEdgeUsage/save_template/toolcfg.tools @@ -2,6 +2,7 @@ + diff --git a/tests/tools/route/countEdgeUsage/subpart_gap/errors.tools b/tests/tools/route/countEdgeUsage/subpart_gap/errors.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/route/countEdgeUsage/subpart_gap/options.tools b/tests/tools/route/countEdgeUsage/subpart_gap/options.tools new file mode 100644 index 000000000000..3778722bf2ac --- /dev/null +++ b/tests/tools/route/countEdgeUsage/subpart_gap/options.tools @@ -0,0 +1 @@ +routes.rou.xml --output-file out.rou.xml --subpart b,d -v --subpart.via tools/countEdgeUsage.py diff --git a/tests/tools/route/countEdgeUsage/subpart_gap/output.tools b/tests/tools/route/countEdgeUsage/subpart_gap/output.tools new file mode 100644 index 000000000000..4018a59e41ca --- /dev/null +++ b/tests/tools/route/countEdgeUsage/subpart_gap/output.tools @@ -0,0 +1,3 @@ +Loaded 1 routes +departEdges: count 1, min 1.00 (a), max 1.00 (a), mean 1.00, Q1 1.00, median 1.00, Q3 1.00 +arrivalEdges: count 1, min 1.00 (d), max 1.00 (d), mean 1.00, Q1 1.00, median 1.00, Q3 1.00 diff --git a/tests/tools/route/countEdgeUsage/subpart_gap/routes.tools b/tests/tools/route/countEdgeUsage/subpart_gap/routes.tools new file mode 100644 index 000000000000..a7fd93f050c2 --- /dev/null +++ b/tests/tools/route/countEdgeUsage/subpart_gap/routes.tools @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/tools/route/countEdgeUsage/testsuite.tools b/tests/tools/route/countEdgeUsage/testsuite.tools index f38ca4115dc8..9ce4faa2f3f9 100644 --- a/tests/tools/route/countEdgeUsage/testsuite.tools +++ b/tests/tools/route/countEdgeUsage/testsuite.tools @@ -20,6 +20,9 @@ taz_subpart # Tests for /tools/countEdgeUsage.py subpart +# Tests for /tools/countEdgeUsage.py +subpart_gap + # Tests for /tools/countEdgeUsage.py subpart_trip From e26187cbbb0b593baad01db6bc485e41a0ff0521 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Fri, 17 Jan 2025 14:42:50 +0100 Subject: [PATCH 007/116] fix #16041 --- tools/countEdgeUsage.py | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/tools/countEdgeUsage.py b/tools/countEdgeUsage.py index 4a3c035cb3df..2778ad242c55 100755 --- a/tools/countEdgeUsage.py +++ b/tools/countEdgeUsage.py @@ -39,6 +39,8 @@ def parse_args(): op.add_argument("--subpart-file", dest="subpart_file", category="processing", type=op.additional_file, help="Restrict counts to routes that contain one of the consecutive edge sequences " + "in the given input file (one sequence per line)") + op.add_argument("--subpart.via", action="store_true", default=False, category="processing", dest="subpartVia", + help="Use subpart as via-edges (permit gaps)") op.add_argument("-i", "--intermediate", action="store_true", default=False, category="processing", help="count all edges of a route") op.add_argument("--taz", action="store_true", default=False, category="processing", @@ -108,13 +110,28 @@ def parse_args(): return options -def hasSubpart(edges, subparts): +def hasVias(edges, vias): + if not vias: + return True + elif len(edges) < len(vias): + return False + for i, e in enumerate(edges): + if e == vias[0] and hasVias(edges[i + 1:], vias[1:]): + return True + return False + + +def hasSubpart(edges, subparts, isVia): if not subparts: return True for subpart in subparts: - for i in range(len(edges)): - if edges[i:i + len(subpart)] == subpart: + if isVia: + if hasVias(edges, subpart): return True + else: + for i in range(len(edges)): + if edges[i:i + len(subpart)] == subpart: + return True return False @@ -198,7 +215,7 @@ def parseSimple(outf, options): break for route in parse_fast(routefile, element, ['edges']): edges = route.edges.split() - if not hasSubpart(edges, options.subparts): + if not hasSubpart(edges, options.subparts, options.subpartVia): continue departCounts[edges[0]] += 1 arrivalCounts[edges[-1]] += 1 @@ -211,14 +228,14 @@ def parseSimple(outf, options): if 'trip' in options.elements: for routefile in options.routefiles: for trip in parse_fast(routefile, 'trip', ['id', fromAttr, toAttr]): - if not hasSubpart([trip[1], trip[2]], options.subparts): + if not hasSubpart([trip[1], trip[2]], options.subparts, options.subpartVia): continue departCounts[trip[1]] += 1 arrivalCounts[trip[2]] += 1 if 'walk' in options.elements: for routefile in options.routefiles: for walk in parse_fast(routefile, 'walk', ['from', 'to']): - if not hasSubpart([walk[1], walk[2]], options.subparts): + if not hasSubpart([walk[1], walk[2]], options.subparts, options.subpartVia): continue departCounts[walk.attr_from] += 1 arrivalCounts[walk.to] += 1 @@ -284,7 +301,7 @@ def parseTimed(outf, options): number = getFlowNumber(elem) if elem.name == 'flow' else 1 src, dst, edges = getEdges(elem, options.taz, routeDict) filterBy = [src, dst] if options.taz or not edges else edges - if not hasSubpart(filterBy, options.subparts): + if not hasSubpart(filterBy, options.subparts, options.subpartVia): continue departCounts[src] += number arrivalCounts[dst] += number From 2f70205541a7f6a359c75134f37e2ffeb1fbbed5 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Fri, 17 Jan 2025 11:07:45 +0100 Subject: [PATCH 008/116] Optimized GNEHierarchicalContainer to avoid bottlenecks inserting elements. Refs #15844 --- .../elements/GNEHierarchicalContainer.cpp | 187 ++++++------------ .../elements/GNEHierarchicalContainer.h | 11 +- .../elements/GNEHierarchicalElement.cpp | 168 ---------------- src/netedit/elements/GNEHierarchicalElement.h | 17 +- 4 files changed, 77 insertions(+), 306 deletions(-) diff --git a/src/netedit/elements/GNEHierarchicalContainer.cpp b/src/netedit/elements/GNEHierarchicalContainer.cpp index 005b5fe89898..485b1d417d9f 100644 --- a/src/netedit/elements/GNEHierarchicalContainer.cpp +++ b/src/netedit/elements/GNEHierarchicalContainer.cpp @@ -21,11 +21,7 @@ #include -// =========================================================================== -// static member definitions -// =========================================================================== - -const bool GNEHierarchicalContainer::checkContainer = true; +#define CHECK_DUPLICATES // =========================================================================== // member method definitions @@ -70,77 +66,47 @@ GNEHierarchicalContainer::getContainerSize() const { template <> void -GNEHierarchicalContainer::addParentElement(const GNEHierarchicalElement* hierarchicalElement, GNEJunction* junction) { - // check junction - if (checkContainer && (std::find(myParentJunctions.begin(), myParentJunctions.end(), junction) != myParentJunctions.end())) { - throw ProcessError(junction->getTagStr() + " with ID='" + junction->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myParentJunctions.push_back(junction); - } +GNEHierarchicalContainer::addParentElement(GNEJunction* junction) { + myParentJunctions.push_back(junction); } template <> void -GNEHierarchicalContainer::addParentElement(const GNEHierarchicalElement* hierarchicalElement, GNEEdge* edge) { - // check edge - if (checkContainer && (std::find(myParentEdges.begin(), myParentEdges.end(), edge) != myParentEdges.end())) { - throw ProcessError(edge->getTagStr() + " with ID='" + edge->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myParentEdges.push_back(edge); - } +GNEHierarchicalContainer::addParentElement(GNEEdge* edge) { + myParentEdges.push_back(edge); } template <> void -GNEHierarchicalContainer::addParentElement(const GNEHierarchicalElement* hierarchicalElement, GNELane* lane) { - // check lane - if (checkContainer && (std::find(myParentLanes.begin(), myParentLanes.end(), lane) != myParentLanes.end())) { - throw ProcessError(lane->getTagStr() + " with ID='" + lane->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myParentLanes.push_back(lane); - } +GNEHierarchicalContainer::addParentElement(GNELane* lane) { + myParentLanes.push_back(lane); } template <> void -GNEHierarchicalContainer::addParentElement(const GNEHierarchicalElement* hierarchicalElement, GNEAdditional* additional) { - // check additional - if (checkContainer && (std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional) != myParentAdditionals.end())) { - throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myParentAdditionals.push_back(additional); - } +GNEHierarchicalContainer::addParentElement(GNEAdditional* additional) { + myParentAdditionals.push_back(additional); } template <> void -GNEHierarchicalContainer::addParentElement(const GNEHierarchicalElement* hierarchicalElement, GNEDemandElement* demandElement) { - // check TAZElement - if (checkContainer && (std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement) != myParentDemandElements.end())) { - throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myParentDemandElements.push_back(demandElement); - } +GNEHierarchicalContainer::addParentElement(GNEDemandElement* demandElement) { + myParentDemandElements.push_back(demandElement); } template <> void -GNEHierarchicalContainer::addParentElement(const GNEHierarchicalElement* hierarchicalElement, GNEGenericData* genericData) { - // check generic data - if (checkContainer && (std::find(myParentGenericDatas.begin(), myParentGenericDatas.end(), genericData) != myParentGenericDatas.end())) { - throw ProcessError(genericData->getTagStr() + " with ID='" + genericData->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myParentGenericDatas.push_back(genericData); - } +GNEHierarchicalContainer::addParentElement(GNEGenericData* genericData) { + myParentGenericDatas.push_back(genericData); } template <> void -GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hierarchicalElement, GNEJunction* junction) { +GNEHierarchicalContainer::removeParentElement(GNEJunction* junction) { // check junction auto it = std::find(myParentJunctions.begin(), myParentJunctions.end(), junction); - if (checkContainer && (it == myParentJunctions.end())) { - throw ProcessError(junction->getTagStr() + " with ID='" + junction->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myParentJunctions.end()) { + throw ProcessError(junction->getTagStr() + " with ID='" + junction->getID() + "' is not a parent element"); } else { myParentJunctions.erase(it); } @@ -148,11 +114,11 @@ GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hier template <> void -GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hierarchicalElement, GNEEdge* edge) { +GNEHierarchicalContainer::removeParentElement(GNEEdge* edge) { // check edge auto it = std::find(myParentEdges.begin(), myParentEdges.end(), edge); - if (checkContainer && (it == myParentEdges.end())) { - throw ProcessError(edge->getTagStr() + " with ID='" + edge->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myParentEdges.end()) { + throw ProcessError(edge->getTagStr() + " with ID='" + edge->getID() + "' is not a parent element"); } else { myParentEdges.erase(it); } @@ -160,11 +126,11 @@ GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hier template <> void -GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hierarchicalElement, GNELane* lane) { +GNEHierarchicalContainer::removeParentElement(GNELane* lane) { // check lane auto it = std::find(myParentLanes.begin(), myParentLanes.end(), lane); - if (checkContainer && (it == myParentLanes.end())) { - throw ProcessError(lane->getTagStr() + " with ID='" + lane->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myParentLanes.end()) { + throw ProcessError(lane->getTagStr() + " with ID='" + lane->getID() + "' is not a parent element"); } else { myParentLanes.erase(it); } @@ -172,11 +138,11 @@ GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hier template <> void -GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hierarchicalElement, GNEAdditional* additional) { +GNEHierarchicalContainer::removeParentElement(GNEAdditional* additional) { // check additional auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional); - if (checkContainer && (it == myParentAdditionals.end())) { - throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myParentAdditionals.end()) { + throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' is not a parent element"); } else { myParentAdditionals.erase(it); } @@ -184,11 +150,11 @@ GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hier template <> void -GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hierarchicalElement, GNEDemandElement* demandElement) { +GNEHierarchicalContainer::removeParentElement(GNEDemandElement* demandElement) { // check TAZElement auto it = std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement); - if (checkContainer && (it == myParentDemandElements.end())) { - throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myParentDemandElements.end()) { + throw ProcessError(demandElement->getTagStr() + " is not a parent element"); } else { myParentDemandElements.erase(it); } @@ -196,11 +162,11 @@ GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hier template <> void -GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hierarchicalElement, GNEGenericData* genericData) { +GNEHierarchicalContainer::removeParentElement(GNEGenericData* genericData) { // check generic data auto it = std::find(myParentGenericDatas.begin(), myParentGenericDatas.end(), genericData); - if (checkContainer && (it == myParentGenericDatas.end())) { - throw ProcessError(genericData->getTagStr() + " with ID='" + genericData->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myParentGenericDatas.end()) { + throw ProcessError(genericData->getTagStr() + " is not a parent element"); } else { myParentGenericDatas.erase(it); } @@ -208,81 +174,48 @@ GNEHierarchicalContainer::removeParentElement(const GNEHierarchicalElement* hier template <> void -GNEHierarchicalContainer::addChildElement(const GNEHierarchicalElement* hierarchicalElement, GNEJunction* junction) { - // check junction - if (checkContainer && (std::find(myChildJunctions.begin(), myChildJunctions.end(), junction) != myChildJunctions.end())) { - throw ProcessError(junction->getTagStr() + " with ID='" + junction->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myChildJunctions.push_back(junction); - } +GNEHierarchicalContainer::addChildElement(GNEJunction* junction) { + myChildJunctions.push_back(junction); } template <> void -GNEHierarchicalContainer::addChildElement(const GNEHierarchicalElement* hierarchicalElement, GNEEdge* edge) { - // check edge - if (checkContainer && (std::find(myChildEdges.begin(), myChildEdges.end(), edge) != myChildEdges.end())) { - throw ProcessError(edge->getTagStr() + " with ID='" + edge->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myChildEdges.push_back(edge); - } +GNEHierarchicalContainer::addChildElement(GNEEdge* edge) { + myChildEdges.push_back(edge); } template <> void -GNEHierarchicalContainer::addChildElement(const GNEHierarchicalElement* hierarchicalElement, GNELane* lane) { - // check lane - if (checkContainer && (std::find(myChildLanes.begin(), myChildLanes.end(), lane) != myChildLanes.end())) { - throw ProcessError(lane->getTagStr() + " with ID='" + lane->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myChildLanes.push_back(lane); - } +GNEHierarchicalContainer::addChildElement(GNELane* lane) { + myChildLanes.push_back(lane); } template <> void -GNEHierarchicalContainer::addChildElement(const GNEHierarchicalElement* hierarchicalElement, GNEAdditional* additional) { - // check additional - if (checkContainer && (std::find(myChildAdditionals.begin(), myChildAdditionals.end(), additional) != myChildAdditionals.end())) { - throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myChildAdditionals.push_back(additional); - } +GNEHierarchicalContainer::addChildElement(GNEAdditional* additional) { + myChildAdditionals.push_back(additional); } template <> void -GNEHierarchicalContainer::addChildElement(const GNEHierarchicalElement* /*hierarchicalElement*/, GNEDemandElement* demandElement) { - /* - // check demand element - if (checkContainer && (std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement) != myChildDemandElements.end())) { - throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' was already inserted in " + demandElement->getTagStr() + " with ID='" + demandElement->getID() + "'"); - } else { - myChildDemandElements.push_back(demandElement); - } - */ +GNEHierarchicalContainer::addChildElement(GNEDemandElement* demandElement) { myChildDemandElements.push_back(demandElement); } template <> void -GNEHierarchicalContainer::addChildElement(const GNEHierarchicalElement* hierarchicalElement, GNEGenericData* genericData) { - // check generic data - if (checkContainer && (std::find(myChildGenericDatas.begin(), myChildGenericDatas.end(), genericData) != myChildGenericDatas.end())) { - throw ProcessError(genericData->getTagStr() + " with ID='" + genericData->getID() + "' was already inserted in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); - } else { - myChildGenericDatas.push_back(genericData); - } +GNEHierarchicalContainer::addChildElement(GNEGenericData* genericData) { + myChildGenericDatas.push_back(genericData); } template <> void -GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hierarchicalElement, GNEJunction* junction) { +GNEHierarchicalContainer::removeChildElement(GNEJunction* junction) { // check junction auto it = std::find(myChildJunctions.begin(), myChildJunctions.end(), junction); - if (checkContainer && (it == myChildJunctions.end())) { - throw ProcessError(junction->getTagStr() + " with ID='" + junction->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myChildJunctions.end()) { + throw ProcessError(junction->getTagStr() + " is not a child element"); } else { myChildJunctions.erase(it); } @@ -290,11 +223,11 @@ GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hiera template <> void -GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hierarchicalElement, GNEEdge* edge) { +GNEHierarchicalContainer::removeChildElement(GNEEdge* edge) { // check edge auto it = std::find(myChildEdges.begin(), myChildEdges.end(), edge); - if (checkContainer && (it == myChildEdges.end())) { - throw ProcessError(edge->getTagStr() + " with ID='" + edge->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myChildEdges.end()) { + throw ProcessError(edge->getTagStr() + " is not a child element"); } else { myChildEdges.erase(it); } @@ -302,11 +235,11 @@ GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hiera template <> void -GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hierarchicalElement, GNELane* lane) { +GNEHierarchicalContainer::removeChildElement(GNELane* lane) { // check lane auto it = std::find(myChildLanes.begin(), myChildLanes.end(), lane); - if (checkContainer && (it == myChildLanes.end())) { - throw ProcessError(lane->getTagStr() + " with ID='" + lane->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myChildLanes.end()) { + throw ProcessError(lane->getTagStr() + " is not a child element"); } else { myChildLanes.erase(it); } @@ -314,11 +247,11 @@ GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hiera template <> void -GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hierarchicalElement, GNEAdditional* additional) { +GNEHierarchicalContainer::removeChildElement(GNEAdditional* additional) { // check additional auto it = std::find(myChildAdditionals.begin(), myChildAdditionals.end(), additional); - if (checkContainer && (it == myChildAdditionals.end())) { - throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myChildAdditionals.end()) { + throw ProcessError(additional->getTagStr() + " is not a child element"); } else { myChildAdditionals.erase(it); } @@ -326,11 +259,11 @@ GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hiera template <> void -GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hierarchicalElement, GNEDemandElement* demandElement) { +GNEHierarchicalContainer::removeChildElement(GNEDemandElement* demandElement) { // check demand element auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); - if (checkContainer && (it == myChildDemandElements.end())) { - throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myChildDemandElements.end()) { + throw ProcessError(demandElement->getTagStr() + " is not a child element"); } else { myChildDemandElements.erase(it); } @@ -338,11 +271,11 @@ GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hiera template <> void -GNEHierarchicalContainer::removeChildElement(const GNEHierarchicalElement* hierarchicalElement, GNEGenericData* genericData) { +GNEHierarchicalContainer::removeChildElement(GNEGenericData* genericData) { // check generic data auto it = std::find(myChildGenericDatas.begin(), myChildGenericDatas.end(), genericData); - if (checkContainer && (it == myChildGenericDatas.end())) { - throw ProcessError(genericData->getTagStr() + " with ID='" + genericData->getID() + "' doesn't exist in " + hierarchicalElement->getTagStr() + " with ID='" + hierarchicalElement->getID() + "'"); + if (it == myChildGenericDatas.end()) { + throw ProcessError(genericData->getTagStr() + " is not a child element"); } else { myChildGenericDatas.erase(it); } diff --git a/src/netedit/elements/GNEHierarchicalContainer.h b/src/netedit/elements/GNEHierarchicalContainer.h index bb8baab6bf06..86bfc9fdece7 100644 --- a/src/netedit/elements/GNEHierarchicalContainer.h +++ b/src/netedit/elements/GNEHierarchicalContainer.h @@ -59,19 +59,19 @@ class GNEHierarchicalContainer { /// @brief add parent element template - void addParentElement(const GNEHierarchicalElement* hierarchicalElement, T* element); + void addParentElement(T* element); /// @brief remove parent element template - void removeParentElement(const GNEHierarchicalElement* hierarchicalElement, T* element); + void removeParentElement(T* element); /// @brief add child element template - void addChildElement(const GNEHierarchicalElement* hierarchicalElement, T* element); + void addChildElement(T* element); /// @brief remove child element template - void removeChildElement(const GNEHierarchicalElement* hierarchicalElement, T* element); + void removeChildElement(T* element); /// @brief get parents template @@ -125,7 +125,4 @@ class GNEHierarchicalContainer { /// @brief vector with the generic child data elements std::vector myChildGenericDatas; - - /// @brief flag for enable/disable check duplicate elements (only used for debug purposes) - static const bool checkContainer; }; diff --git a/src/netedit/elements/GNEHierarchicalElement.cpp b/src/netedit/elements/GNEHierarchicalElement.cpp index 6ab525c6f249..47acb0729892 100644 --- a/src/netedit/elements/GNEHierarchicalElement.cpp +++ b/src/netedit/elements/GNEHierarchicalElement.cpp @@ -203,174 +203,6 @@ GNEHierarchicalElement::getChildGenericDatas() const { } -template<> void -GNEHierarchicalElement::addParentElement(GNEJunction* element) { - // add parent element into container - myHierarchicalContainer.addParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addParentElement(GNEEdge* element) { - // add parent element into container - myHierarchicalContainer.addParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addParentElement(GNELane* element) { - // add parent element into container - myHierarchicalContainer.addParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addParentElement(GNEAdditional* element) { - // add parent element into container - myHierarchicalContainer.addParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addParentElement(GNEDemandElement* element) { - // add parent element into container - myHierarchicalContainer.addParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addParentElement(GNEGenericData* element) { - // add parent element into container - myHierarchicalContainer.addParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeParentElement(GNEJunction* element) { - // remove parent element from container - myHierarchicalContainer.removeParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeParentElement(GNEEdge* element) { - // remove parent element from container - myHierarchicalContainer.removeParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeParentElement(GNELane* element) { - // remove parent element from container - myHierarchicalContainer.removeParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeParentElement(GNEAdditional* element) { - // remove parent element from container - myHierarchicalContainer.removeParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeParentElement(GNEDemandElement* element) { - // remove parent element from container - myHierarchicalContainer.removeParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeParentElement(GNEGenericData* element) { - // remove parent element from container - myHierarchicalContainer.removeParentElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addChildElement(GNEJunction* element) { - // add child element into container - myHierarchicalContainer.addChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addChildElement(GNEEdge* element) { - // add child element into container - myHierarchicalContainer.addChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addChildElement(GNELane* element) { - // add child element into container - myHierarchicalContainer.addChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addChildElement(GNEAdditional* element) { - // add child element into container - myHierarchicalContainer.addChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addChildElement(GNEDemandElement* element) { - // add child element into container - myHierarchicalContainer.addChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::addChildElement(GNEGenericData* element) { - // add child element into container - myHierarchicalContainer.addChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeChildElement(GNEJunction* element) { - // remove child element from container - myHierarchicalContainer.removeChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeChildElement(GNEEdge* element) { - // remove child element from container - myHierarchicalContainer.removeChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeChildElement(GNELane* element) { - // remove child element from container - myHierarchicalContainer.removeChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeChildElement(GNEAdditional* element) { - // remove child element from container - myHierarchicalContainer.removeChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeChildElement(GNEDemandElement* element) { - // remove child element from container - myHierarchicalContainer.removeChildElement(this, element); -} - - -template<> void -GNEHierarchicalElement::removeChildElement(GNEGenericData* element) { - // remove child element from container - myHierarchicalContainer.removeChildElement(this, element); -} - - std::string GNEHierarchicalElement::getNewListOfParents(const GNENetworkElement* currentElement, const GNENetworkElement* newNextElement) const { std::vector solution; diff --git a/src/netedit/elements/GNEHierarchicalElement.h b/src/netedit/elements/GNEHierarchicalElement.h index f14b40948c12..ccfd58f5b45c 100644 --- a/src/netedit/elements/GNEHierarchicalElement.h +++ b/src/netedit/elements/GNEHierarchicalElement.h @@ -136,19 +136,28 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { /// @brief add parent element template - void addParentElement(T* element); + void addParentElement(T* element) { + myHierarchicalContainer.addParentElement(element); + } /// @brief remove parent element template - void removeParentElement(T* element); + void removeParentElement(T* element) { + myHierarchicalContainer.removeParentElement(element); + } /// @brief add child element template - void addChildElement(T* element); + void addChildElement(T* element) { + myHierarchicalContainer.addChildElement(element); + } /// @brief remove child element template - void removeChildElement(T* element); + void removeChildElement(T* element) { + myHierarchicalContainer.removeChildElement(element); + } + /// @} /// @name specific get functions From af77d1912ae1bd7880da8b0c34eec58e35e1f8ec Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Fri, 17 Jan 2025 12:37:33 +0100 Subject: [PATCH 009/116] Fixed #16037 --- .../additional/GNEAdditionalHandler.cpp | 77 ++++--------------- 1 file changed, 16 insertions(+), 61 deletions(-) diff --git a/src/netedit/elements/additional/GNEAdditionalHandler.cpp b/src/netedit/elements/additional/GNEAdditionalHandler.cpp index 64af96582a42..8e9ea65427c3 100644 --- a/src/netedit/elements/additional/GNEAdditionalHandler.cpp +++ b/src/netedit/elements/additional/GNEAdditionalHandler.cpp @@ -1323,7 +1323,7 @@ GNEAdditionalHandler::buildTAZ(const CommonXMLStructure::SumoBaseObject* sumoBas } // iterate over children and add sourceSinkEdge boundaries to make a taz shape for (const auto& sourceSink : sumoBaseObject->getSumoBaseObjectChildren()) { - // check that childre is a source or sink elements (to abool parameters) + // check that child is a source or sink elements (to avoid other elements) if ((sourceSink->getTag() == SUMO_TAG_TAZSOURCE) || (sourceSink->getTag() == SUMO_TAG_TAZSINK)) { const GNEEdge* sourceSinkEdge = myNet->getAttributeCarriers()->retrieveEdge(sourceSink->getStringAttribute(SUMO_ATTR_ID), false); if (sourceSinkEdge) { @@ -1393,41 +1393,18 @@ GNEAdditionalHandler::buildTAZSource(const CommonXMLStructure::SumoBaseObject* s GNEAdditional* TAZ = getAdditionalParent(sumoBaseObject, SUMO_TAG_TAZ); // get edge GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(edgeID, false); - // declare TAZ Sink - GNEAdditional* TAZSink = nullptr; // check parents if (TAZ == nullptr) { - return writeErrorInvalidParent(SUMO_TAG_SOURCE, "", SUMO_TAG_TAZ, sumoBaseObject->getParentSumoBaseObject()->getStringAttribute(SUMO_ATTR_ID)); + return writeErrorInvalidParent(SUMO_TAG_SOURCE, edgeID, SUMO_TAG_TAZ, sumoBaseObject->getParentSumoBaseObject()->getStringAttribute(SUMO_ATTR_ID)); } else if (edge == nullptr) { - return writeErrorInvalidParent(SUMO_TAG_SOURCE, "", SUMO_TAG_EDGE, edgeID); + return writeErrorInvalidParent(SUMO_TAG_SOURCE, edgeID, SUMO_TAG_EDGE, TAZ->getID()); } else { - // first check if a TAZSink in the same edge for the same TAZ - for (const auto& TAZElement : edge->getChildAdditionals()) { - if ((TAZElement->getTagProperty().getTag() == SUMO_TAG_TAZSINK) && (TAZElement->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { - TAZSink = TAZElement; - } - } - // check if TAZSink has to be created - if (TAZSink == nullptr) { - // Create TAZ with weight 0 (default) - TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, 0); - // add it depending of allow undoRed - if (myAllowUndoRedo) { - myNet->getViewNet()->getUndoList()->begin(TAZ, TL("add TAZ Sink in '") + TAZ->getID() + "'"); - myNet->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); - myNet->getViewNet()->getUndoList()->end(); - } else { - myNet->getAttributeCarriers()->insertAdditional(TAZSink); - TAZ->addChildElement(TAZSink); - TAZSink->incRef("buildTAZSource"); - } - } - // now check check if TAZSource exist + // declare TAZ Source GNEAdditional* TAZSource = nullptr; - // first check if a TAZSink in the same edge for the same TAZ - for (const auto& TAZElement : edge->getChildAdditionals()) { - if ((TAZElement->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) && (TAZElement->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { - TAZSource = TAZElement; + // first check if already exist a TAZ Source for the given edge and TAZ + for (auto it = edge->getChildAdditionals().begin(); (it != edge->getChildAdditionals().end()) && !TAZSource; it++) { + if (((*it)->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) && ((*it)->getParentAdditionals().front() == TAZ)) { + TAZSource = (*it); } } // check if TAZSource has to be created @@ -1467,43 +1444,21 @@ GNEAdditionalHandler::buildTAZSink(const CommonXMLStructure::SumoBaseObject* sum GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(edgeID, false); // check parents if (TAZ == nullptr) { - return writeErrorInvalidParent(SUMO_TAG_SINK, "", SUMO_TAG_TAZ, sumoBaseObject->getParentSumoBaseObject()->getStringAttribute(SUMO_ATTR_ID)); + return writeErrorInvalidParent(SUMO_TAG_SOURCE, edgeID, SUMO_TAG_TAZ, sumoBaseObject->getParentSumoBaseObject()->getStringAttribute(SUMO_ATTR_ID)); } else if (edge == nullptr) { - return writeErrorInvalidParent(SUMO_TAG_SINK, "", SUMO_TAG_EDGE, edgeID); + return writeErrorInvalidParent(SUMO_TAG_SOURCE, edgeID, SUMO_TAG_EDGE, TAZ->getID()); } else { - // declare TAZ source - GNEAdditional* TAZSource = nullptr; - // first check if a TAZSink in the same edge for the same TAZ - for (const auto& TAZElement : edge->getChildAdditionals()) { - if ((TAZElement->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) && (TAZElement->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { - TAZSource = TAZElement; - } - } - // check if TAZSource has to be created - if (TAZSource == nullptr) { - // Create TAZ with empty value - TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, 0); - // add it depending of allow undoRed - if (myAllowUndoRedo) { - myNet->getViewNet()->getUndoList()->begin(TAZ, TL("add TAZ Source in '") + TAZ->getID() + "'"); - myNet->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); - myNet->getViewNet()->getUndoList()->end(); - } else { - myNet->getAttributeCarriers()->insertAdditional(TAZSource); - TAZ->addChildElement(TAZSource); - TAZSource->incRef("buildTAZSink"); - } - } + // declare TAZ Sink GNEAdditional* TAZSink = nullptr; - // first check if a TAZSink in the same edge for the same TAZ - for (const auto& TAZElement : edge->getChildAdditionals()) { - if ((TAZElement->getTagProperty().getTag() == SUMO_TAG_TAZSINK) && (TAZElement->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { - TAZSink = TAZElement; + // first check if already exist a TAZ Sink for the given edge and TAZ + for (auto it = edge->getChildAdditionals().begin(); (it != edge->getChildAdditionals().end()) && !TAZSink; it++) { + if (((*it)->getTagProperty().getTag() == SUMO_TAG_TAZSINK) && ((*it)->getParentAdditionals().front() == TAZ)) { + TAZSink = (*it); } } // check if TAZSink has to be created if (TAZSink == nullptr) { - // Create TAZ only with arrivalWeight + // Create TAZ only with departWeight TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, arrivalWeight); // add it depending of allow undoRed if (myAllowUndoRedo) { From 8700bd16c4e39b5ab6abaef54680b4b30b62bcd1 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Fri, 17 Jan 2025 13:39:48 +0100 Subject: [PATCH 010/116] Optimiced GUIViewObjectsHandler. Refs #15844 --- src/netedit/GNEViewNet.cpp | 4 ++++ src/utils/gui/div/GUIViewObjectsHandler.cpp | 21 ++++++++++++++++----- src/utils/gui/div/GUIViewObjectsHandler.h | 3 +++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/netedit/GNEViewNet.cpp b/src/netedit/GNEViewNet.cpp index 8ba68063f913..4627eb1cd508 100644 --- a/src/netedit/GNEViewNet.cpp +++ b/src/netedit/GNEViewNet.cpp @@ -496,6 +496,8 @@ GNEViewNet::updateObjectsInBoundary(const Boundary& boundary) { myVisualizationSettings->drawForRectangleSelection = true; // draw all GL elements within the small boundary drawGLElements(boundary); + // swap selected objects (needed after selecting) + gViewObjectsHandler.reverseSelectedObjects(); // restore draw for object under cursor myVisualizationSettings->drawForViewObjectsHandler = false; myVisualizationSettings->drawForRectangleSelection = false; @@ -526,6 +528,8 @@ GNEViewNet::updateObjectsInPosition(const Position& pos) { myVisualizationSettings->drawForViewObjectsHandler = true; // draw all GL elements within the small boundary drawGLElements(positionBoundary); + // swap selected objects (needed after selecting) + gViewObjectsHandler.reverseSelectedObjects(); // check if filter edges that have the mouse over their geometry points if (myEditModes.isCurrentSupermodeNetwork() && myEditModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) { gViewObjectsHandler.isolateEdgeGeometryPoints(); diff --git a/src/utils/gui/div/GUIViewObjectsHandler.cpp b/src/utils/gui/div/GUIViewObjectsHandler.cpp index c01ccbfff179..11bbbd02aa8a 100644 --- a/src/utils/gui/div/GUIViewObjectsHandler.cpp +++ b/src/utils/gui/div/GUIViewObjectsHandler.cpp @@ -273,7 +273,10 @@ GUIViewObjectsHandler::selectObject(const GUIGlObject* GLObject, const double la return false; } else { auto& layerContainer = mySortedSelectedObjects[layer * -1]; - layerContainer.insert(layerContainer.begin(), ObjectContainer(GLObject)); + if (layerContainer.size() == 10) { + layerContainer.reserve(10000000); + } + layerContainer.push_back(ObjectContainer(GLObject)); mySelectedObjects[GLObject] = std::make_pair(fullBoundary, segment); myNumberOfSelectedObjects++; return true; @@ -302,8 +305,8 @@ GUIViewObjectsHandler::selectGeometryPoint(const GUIGlObject* GLObject, const in } // no element found then add it auto& layerContainer = mySortedSelectedObjects[layer * -1]; - auto it = layerContainer.insert(layerContainer.begin(), ObjectContainer(GLObject)); - it->geometryPoints.push_back(newIndex); + layerContainer.push_back(ObjectContainer(GLObject)); + layerContainer.back().geometryPoints.push_back(newIndex); mySelectedObjects[GLObject] = std::make_pair(false, nullptr); myNumberOfSelectedObjects++; return true; @@ -330,8 +333,8 @@ GUIViewObjectsHandler::selectPositionOverShape(const GUIGlObject* GLObject, cons } // no element found then add it auto& layerContainer = mySortedSelectedObjects[layer * -1]; - auto it = layerContainer.insert(layerContainer.begin(), ObjectContainer(GLObject)); - it->posOverShape = pos; + layerContainer.push_back(ObjectContainer(GLObject)); + layerContainer.back().posOverShape = pos; mySelectedObjects[GLObject] = std::make_pair(false, nullptr); myNumberOfSelectedObjects++; return true; @@ -406,6 +409,14 @@ GUIViewObjectsHandler::getNumberOfSelectedObjects() const { } +void +GUIViewObjectsHandler::reverseSelectedObjects() { + for (auto &layerContainer : mySortedSelectedObjects) { + std::reverse(layerContainer.second.begin(), layerContainer.second.end()); + } +} + + const std::set& GUIViewObjectsHandler::getRedrawPathElements() const { return myRedrawPathElements; diff --git a/src/utils/gui/div/GUIViewObjectsHandler.h b/src/utils/gui/div/GUIViewObjectsHandler.h index 92c8dccbb8dc..c8003dcad5b5 100644 --- a/src/utils/gui/div/GUIViewObjectsHandler.h +++ b/src/utils/gui/div/GUIViewObjectsHandler.h @@ -145,6 +145,9 @@ class GUIViewObjectsHandler { /// @brief get number of selected objects int getNumberOfSelectedObjects() const; + /// @brief reverse selected objects + void reverseSelectedObjects(); + /// @} /// @name functions related with redrawing path elements From 696c6ae78f68cc0b488e9dff1a98a74f7f0352b7 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Fri, 17 Jan 2025 14:27:32 +0100 Subject: [PATCH 011/116] Improved efficiency selecting elements using a rectangle. Refs #15844 --- src/utils/gui/div/GUIViewObjectsHandler.cpp | 26 ++++++++++++++------- src/utils/gui/div/GUIViewObjectsHandler.h | 12 +++++++++- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/utils/gui/div/GUIViewObjectsHandler.cpp b/src/utils/gui/div/GUIViewObjectsHandler.cpp index 11bbbd02aa8a..b024f7a3b5f5 100644 --- a/src/utils/gui/div/GUIViewObjectsHandler.cpp +++ b/src/utils/gui/div/GUIViewObjectsHandler.cpp @@ -273,10 +273,7 @@ GUIViewObjectsHandler::selectObject(const GUIGlObject* GLObject, const double la return false; } else { auto& layerContainer = mySortedSelectedObjects[layer * -1]; - if (layerContainer.size() == 10) { - layerContainer.reserve(10000000); - } - layerContainer.push_back(ObjectContainer(GLObject)); + layerContainer.append(ObjectContainer(GLObject)); mySelectedObjects[GLObject] = std::make_pair(fullBoundary, segment); myNumberOfSelectedObjects++; return true; @@ -305,7 +302,7 @@ GUIViewObjectsHandler::selectGeometryPoint(const GUIGlObject* GLObject, const in } // no element found then add it auto& layerContainer = mySortedSelectedObjects[layer * -1]; - layerContainer.push_back(ObjectContainer(GLObject)); + layerContainer.append(ObjectContainer(GLObject)); layerContainer.back().geometryPoints.push_back(newIndex); mySelectedObjects[GLObject] = std::make_pair(false, nullptr); myNumberOfSelectedObjects++; @@ -333,7 +330,7 @@ GUIViewObjectsHandler::selectPositionOverShape(const GUIGlObject* GLObject, cons } // no element found then add it auto& layerContainer = mySortedSelectedObjects[layer * -1]; - layerContainer.push_back(ObjectContainer(GLObject)); + layerContainer.append(ObjectContainer(GLObject)); layerContainer.back().posOverShape = pos; mySelectedObjects[GLObject] = std::make_pair(false, nullptr); myNumberOfSelectedObjects++; @@ -478,7 +475,7 @@ GUIViewObjectsHandler::updateFrontObject(const GUIGlObject* GLObject) { } // add element again wit a new layer if (frontElement.object) { - mySortedSelectedObjects[(double)GLO_FRONTELEMENT].push_back(frontElement); + mySortedSelectedObjects[(double)GLO_FRONTELEMENT].append(frontElement); } } @@ -500,8 +497,21 @@ GUIViewObjectsHandler::isolateEdgeGeometryPoints() { // clear all selected objects mySortedSelectedObjects.clear(); // add edge with geometry points as front element - mySortedSelectedObjects[(double)GLO_FRONTELEMENT].push_back(edgeWithGeometryPoints); + mySortedSelectedObjects[(double)GLO_FRONTELEMENT].append(edgeWithGeometryPoints); + } +} + + +void +GUIViewObjectsHandler::ObjectContainerLayer::append(const ObjectContainer& objectContainer) { + if (capacity() == size()) { + if (size() < 10) { + reserve(size() + 10); + } else { + reserve(size() + 1000); + } } + push_back(objectContainer); } /****************************************************************************/ diff --git a/src/utils/gui/div/GUIViewObjectsHandler.h b/src/utils/gui/div/GUIViewObjectsHandler.h index c8003dcad5b5..0ac36362107f 100644 --- a/src/utils/gui/div/GUIViewObjectsHandler.h +++ b/src/utils/gui/div/GUIViewObjectsHandler.h @@ -63,8 +63,18 @@ class GUIViewObjectsHandler { double offset = 0; }; + /// @brief object container layer + struct ObjectContainerLayer : public std::vector { + + /// @brief parameter constructor + ObjectContainerLayer() {} + + // @brief append object container and resize if neccesary + void append(const ObjectContainer &objectContainer); + }; + /// @brief typedef for pack elements sorted by layer - typedef std::map > GLObjectsSortedContainer; + typedef std::map GLObjectsSortedContainer; /// @brief constructor GUIViewObjectsHandler(); From e76e7c5c46368c0ca77862965a19c54c6e6b42ee Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Fri, 17 Jan 2025 15:29:48 +0100 Subject: [PATCH 012/116] Updated netedit tests. Refs #3045 --- .../load/invalid/datas/additionals.netedit | 18 +++++++++--------- .../load/invalid/demands/additionals.netedit | 18 +++++++++--------- .../load/invalid/meandatas/additionals.netedit | 18 +++++++++--------- .../netecfg/load/valid/additionals.netedit | 18 +++++++++--------- .../open/menu/additionals/additionals.netedit | 18 +++++++++--------- .../open/menu/datas/additionals.netedit | 18 +++++++++--------- .../open/menu/demands/additionals.netedit | 18 +++++++++--------- .../cancel/additionals/additionals.netedit | 18 +++++++++--------- .../cancel/datas/additionals.netedit | 18 +++++++++--------- .../cancel/demands/additionals.netedit | 18 +++++++++--------- .../cancel/meandatas/additionals.netedit | 18 +++++++++--------- .../no/additionals/additionals.netedit | 18 +++++++++--------- .../overwritte/no/datas/additionals.netedit | 18 +++++++++--------- .../no/meandatas/additionals.netedit | 18 +++++++++--------- .../yes/additionals/additionals.netedit | 18 +++++++++--------- .../overwritte/yes/datas/additionals.netedit | 18 +++++++++--------- .../yes/meandatas/additionals.netedit | 18 +++++++++--------- .../shortcuts/additionals/additionals.netedit | 18 +++++++++--------- .../open/shortcuts/datas/additionals.netedit | 18 +++++++++--------- .../open/shortcuts/demands/additionals.netedit | 18 +++++++++--------- .../save/menu/additionals/additionals.netedit | 18 +++++++++--------- .../save/menu/datas/additionals.netedit | 18 +++++++++--------- .../save/menu/demands/additionals.netedit | 18 +++++++++--------- .../save/menu/meandatas/additionals.netedit | 18 +++++++++--------- .../save/menu/network/additionals.netedit | 18 +++++++++--------- .../shortcuts/additionals/additionals.netedit | 18 +++++++++--------- .../save/shortcuts/datas/additionals.netedit | 18 +++++++++--------- .../save/shortcuts/demands/additionals.netedit | 18 +++++++++--------- .../save/shortcuts/network/additionals.netedit | 18 +++++++++--------- .../save_as/additionals/additionalsas.netedit | 18 +++++++++--------- .../netecfg/save_as/datas/additionals.netedit | 18 +++++++++--------- .../save_as/demands/additionals.netedit | 18 +++++++++--------- .../save_as/meandatas/additionals.netedit | 18 +++++++++--------- .../save_as/network/additionals.netedit | 18 +++++++++--------- .../load/route/additionals.netedit | 10 +++++----- .../load/route/additionals.netedit | 10 +++++----- 36 files changed, 316 insertions(+), 316 deletions(-) diff --git a/tests/netedit/basic/configs/netecfg/load/invalid/datas/additionals.netedit b/tests/netedit/basic/configs/netecfg/load/invalid/datas/additionals.netedit index 0dffb28a5d9a..ff3034e601e8 100644 --- a/tests/netedit/basic/configs/netecfg/load/invalid/datas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/load/invalid/datas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/load/invalid/demands/additionals.netedit b/tests/netedit/basic/configs/netecfg/load/invalid/demands/additionals.netedit index b1ae5415df9c..ace8b137d6cd 100644 --- a/tests/netedit/basic/configs/netecfg/load/invalid/demands/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/load/invalid/demands/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/load/invalid/meandatas/additionals.netedit b/tests/netedit/basic/configs/netecfg/load/invalid/meandatas/additionals.netedit index 5dce1e534a39..bd6dc15db69d 100644 --- a/tests/netedit/basic/configs/netecfg/load/invalid/meandatas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/load/invalid/meandatas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/load/valid/additionals.netedit b/tests/netedit/basic/configs/netecfg/load/valid/additionals.netedit index 4f7a3a5a4aee..18f70881fd66 100644 --- a/tests/netedit/basic/configs/netecfg/load/valid/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/load/valid/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/menu/additionals/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/menu/additionals/additionals.netedit index eb4aefe68ce6..6005e8fc5684 100644 --- a/tests/netedit/basic/configs/netecfg/open/menu/additionals/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/menu/additionals/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/menu/datas/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/menu/datas/additionals.netedit index a92ccfbf62a5..761e8eb5909c 100644 --- a/tests/netedit/basic/configs/netecfg/open/menu/datas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/menu/datas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/menu/demands/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/menu/demands/additionals.netedit index 968a81cee32d..ac637a817a7a 100644 --- a/tests/netedit/basic/configs/netecfg/open/menu/demands/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/menu/demands/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/additionals/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/additionals/additionals.netedit index 0b64a8cbebef..a83fcce61d28 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/additionals/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/additionals/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/datas/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/datas/additionals.netedit index cf50c213d416..8f37441278ee 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/datas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/datas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/demands/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/demands/additionals.netedit index a659291102e2..cdc73a9cf69a 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/demands/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/demands/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/meandatas/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/meandatas/additionals.netedit index ca92193fada8..3f18a1a867a9 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/meandatas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/cancel/meandatas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/no/additionals/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/overwritte/no/additionals/additionals.netedit index c9f64e0096c6..aaa99de1a1c0 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/no/additionals/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/no/additionals/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/no/datas/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/overwritte/no/datas/additionals.netedit index 5840325680c8..8ede0860a292 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/no/datas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/no/datas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/no/meandatas/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/overwritte/no/meandatas/additionals.netedit index 2122db3785d9..eae536a6f2bf 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/no/meandatas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/no/meandatas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/yes/additionals/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/overwritte/yes/additionals/additionals.netedit index 1c777cc0f162..a9af52d6af09 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/yes/additionals/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/yes/additionals/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/yes/datas/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/overwritte/yes/datas/additionals.netedit index 3109460997bc..ece485e72269 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/yes/datas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/yes/datas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/yes/meandatas/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/overwritte/yes/meandatas/additionals.netedit index b2872ba7bcb4..3c88150535ae 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/yes/meandatas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/yes/meandatas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/shortcuts/additionals/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/shortcuts/additionals/additionals.netedit index e002d63639a5..2796280cdd6c 100644 --- a/tests/netedit/basic/configs/netecfg/open/shortcuts/additionals/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/shortcuts/additionals/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/shortcuts/datas/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/shortcuts/datas/additionals.netedit index e265f1faa4cf..5b8762df5a40 100644 --- a/tests/netedit/basic/configs/netecfg/open/shortcuts/datas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/shortcuts/datas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/open/shortcuts/demands/additionals.netedit b/tests/netedit/basic/configs/netecfg/open/shortcuts/demands/additionals.netedit index 33afb260f831..ef6ee777c9db 100644 --- a/tests/netedit/basic/configs/netecfg/open/shortcuts/demands/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/open/shortcuts/demands/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save/menu/additionals/additionals.netedit b/tests/netedit/basic/configs/netecfg/save/menu/additionals/additionals.netedit index 0b4d0dda187a..b785eb266b26 100644 --- a/tests/netedit/basic/configs/netecfg/save/menu/additionals/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save/menu/additionals/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save/menu/datas/additionals.netedit b/tests/netedit/basic/configs/netecfg/save/menu/datas/additionals.netedit index b3335700c663..e85b7d8a5d88 100644 --- a/tests/netedit/basic/configs/netecfg/save/menu/datas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save/menu/datas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save/menu/demands/additionals.netedit b/tests/netedit/basic/configs/netecfg/save/menu/demands/additionals.netedit index 1bea2d9ead0d..5c04fcfad4aa 100644 --- a/tests/netedit/basic/configs/netecfg/save/menu/demands/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save/menu/demands/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save/menu/meandatas/additionals.netedit b/tests/netedit/basic/configs/netecfg/save/menu/meandatas/additionals.netedit index 3d17626410f1..4ae281c06cdc 100644 --- a/tests/netedit/basic/configs/netecfg/save/menu/meandatas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save/menu/meandatas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save/menu/network/additionals.netedit b/tests/netedit/basic/configs/netecfg/save/menu/network/additionals.netedit index 120d8b844a61..bcb173059225 100644 --- a/tests/netedit/basic/configs/netecfg/save/menu/network/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save/menu/network/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save/shortcuts/additionals/additionals.netedit b/tests/netedit/basic/configs/netecfg/save/shortcuts/additionals/additionals.netedit index df8db8a4ace5..e2aebea863c3 100644 --- a/tests/netedit/basic/configs/netecfg/save/shortcuts/additionals/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save/shortcuts/additionals/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save/shortcuts/datas/additionals.netedit b/tests/netedit/basic/configs/netecfg/save/shortcuts/datas/additionals.netedit index cd0256134a09..90fd8d744455 100644 --- a/tests/netedit/basic/configs/netecfg/save/shortcuts/datas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save/shortcuts/datas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save/shortcuts/demands/additionals.netedit b/tests/netedit/basic/configs/netecfg/save/shortcuts/demands/additionals.netedit index 73f785893f91..ba7799259d6f 100644 --- a/tests/netedit/basic/configs/netecfg/save/shortcuts/demands/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save/shortcuts/demands/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save/shortcuts/network/additionals.netedit b/tests/netedit/basic/configs/netecfg/save/shortcuts/network/additionals.netedit index 1dbc9ce1d34e..66ec8c8aaaa1 100644 --- a/tests/netedit/basic/configs/netecfg/save/shortcuts/network/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save/shortcuts/network/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save_as/additionals/additionalsas.netedit b/tests/netedit/basic/configs/netecfg/save_as/additionals/additionalsas.netedit index a8c88b8791d9..7f31ef9ee253 100644 --- a/tests/netedit/basic/configs/netecfg/save_as/additionals/additionalsas.netedit +++ b/tests/netedit/basic/configs/netecfg/save_as/additionals/additionalsas.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save_as/datas/additionals.netedit b/tests/netedit/basic/configs/netecfg/save_as/datas/additionals.netedit index 42b1804b2d18..a99edefb5a94 100644 --- a/tests/netedit/basic/configs/netecfg/save_as/datas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save_as/datas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save_as/demands/additionals.netedit b/tests/netedit/basic/configs/netecfg/save_as/demands/additionals.netedit index fa1d08200c61..c07c10b3e90b 100644 --- a/tests/netedit/basic/configs/netecfg/save_as/demands/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save_as/demands/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save_as/meandatas/additionals.netedit b/tests/netedit/basic/configs/netecfg/save_as/meandatas/additionals.netedit index 29d36e77982e..272652fa82b6 100644 --- a/tests/netedit/basic/configs/netecfg/save_as/meandatas/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save_as/meandatas/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/basic/configs/netecfg/save_as/network/additionals.netedit b/tests/netedit/basic/configs/netecfg/save_as/network/additionals.netedit index a9284f747190..8f8a260c0442 100644 --- a/tests/netedit/basic/configs/netecfg/save_as/network/additionals.netedit +++ b/tests/netedit/basic/configs/netecfg/save_as/network/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + - + - + - + - + diff --git a/tests/netedit/elements/demands/flow_embedded/load/route/additionals.netedit b/tests/netedit/elements/demands/flow_embedded/load/route/additionals.netedit index ced64c9b7696..d52dc3f81e5d 100644 --- a/tests/netedit/elements/demands/flow_embedded/load/route/additionals.netedit +++ b/tests/netedit/elements/demands/flow_embedded/load/route/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + diff --git a/tests/netedit/elements/demands/vehicle_embedded/load/route/additionals.netedit b/tests/netedit/elements/demands/vehicle_embedded/load/route/additionals.netedit index f6590046370f..b60d3271c7d6 100644 --- a/tests/netedit/elements/demands/vehicle_embedded/load/route/additionals.netedit +++ b/tests/netedit/elements/demands/vehicle_embedded/load/route/additionals.netedit @@ -1,6 +1,6 @@ - - + - + - + - + From 7a8d15c109ceb48e203f9cdd661990101369e079 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Fri, 17 Jan 2025 15:51:12 +0100 Subject: [PATCH 013/116] fix #16026 --- src/utils/gui/windows/GUISUMOAbstractView.cpp | 31 ++++++++++++++++--- src/utils/gui/windows/GUISUMOAbstractView.h | 2 +- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/utils/gui/windows/GUISUMOAbstractView.cpp b/src/utils/gui/windows/GUISUMOAbstractView.cpp index 63395e69883f..023313370ee4 100644 --- a/src/utils/gui/windows/GUISUMOAbstractView.cpp +++ b/src/utils/gui/windows/GUISUMOAbstractView.cpp @@ -704,16 +704,29 @@ GUISUMOAbstractView::displayLegends() { if (myVisualizationSettings->showSizeLegend) { displayLegend(); } + std::string key = ""; if (myVisualizationSettings->showColorLegend) { - displayColorLegend(myVisualizationSettings->getLaneEdgeScheme(), false); + auto const& scheme = myVisualizationSettings->getLaneEdgeScheme(); + if (scheme.getName() == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) { + key = myVisualizationSettings->edgeData; + } else if (scheme.getName() == GUIVisualizationSettings::SCHEME_NAME_EDGE_PARAM_NUMERICAL) { + key = myVisualizationSettings->edgeParam; + } else if (scheme.getName() == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) { + key = myVisualizationSettings->laneParam; + } + displayColorLegend(scheme, false, key); } if (myVisualizationSettings->showVehicleColorLegend) { - displayColorLegend(myVisualizationSettings->vehicleColorer.getScheme(), true); + auto const& scheme = myVisualizationSettings->vehicleColorer.getScheme(); + if (scheme.getName() == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) { + key = myVisualizationSettings->vehicleParam; + } + displayColorLegend(myVisualizationSettings->vehicleColorer.getScheme(), true, key); } } void -GUISUMOAbstractView::displayColorLegend(const GUIColorScheme& scheme, bool leftSide) { +GUISUMOAbstractView::displayColorLegend(const GUIColorScheme& scheme, bool leftSide, const std::string& key) { // compute the scale bar length glLineWidth(1.0); glMatrixMode(GL_PROJECTION); @@ -839,7 +852,17 @@ GUISUMOAbstractView::displayColorLegend(const GUIColorScheme& scheme, bool leftS } // draw scheme name std::string name = scheme.getName(); - if (StringUtils::startsWith(name, "by ")) { + if (name == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) { + name = "edgeData (" + key + ")"; + } else if (name == GUIVisualizationSettings::SCHEME_NAME_EDGE_PARAM_NUMERICAL) { + name = "edgeParam (" + key + ")"; + } else if (name == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) { + name = "laneParam (" + key + ")"; + } else if (name == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) { + name = "param (" + key + ")"; + } else if (name == GUIVisualizationSettings::SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL) { + name = "attribute (" + key + ")"; + } else if (StringUtils::startsWith(name, "by ")) { name = name.substr(3); } const double topN = -0.8; diff --git a/src/utils/gui/windows/GUISUMOAbstractView.h b/src/utils/gui/windows/GUISUMOAbstractView.h index 0d633820d0e6..08fdd77ae1e7 100644 --- a/src/utils/gui/windows/GUISUMOAbstractView.h +++ b/src/utils/gui/windows/GUISUMOAbstractView.h @@ -495,7 +495,7 @@ class GUISUMOAbstractView : public FXGLCanvas { void displayLegends(); /// @brief Draws a legend for the given scheme - void displayColorLegend(const GUIColorScheme& scheme, bool leftSide); + void displayColorLegend(const GUIColorScheme& scheme, bool leftSide, const std::string& key); /// @brief Draws frames-per-second indicator void drawFPS(); From ab7d0620c099a756f204f33cc91404238a417b0a Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Fri, 17 Jan 2025 16:18:16 +0100 Subject: [PATCH 014/116] Added new class Triangle. Refs #15844 --- src/utils/geom/CMakeLists.txt | 2 ++ src/utils/geom/Triangle.cpp | 31 +++++++++++++++++++++++++++ src/utils/geom/Triangle.h | 40 +++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 src/utils/geom/Triangle.cpp create mode 100644 src/utils/geom/Triangle.h diff --git a/src/utils/geom/CMakeLists.txt b/src/utils/geom/CMakeLists.txt index 92c4f7458cbe..bd0118f9b8ba 100644 --- a/src/utils/geom/CMakeLists.txt +++ b/src/utils/geom/CMakeLists.txt @@ -14,6 +14,8 @@ set(utils_geom_STAT_SRCS Position.h PositionVector.cpp PositionVector.h + Triangle.cpp + Triangle.h ) add_library(utils_geom STATIC ${utils_geom_STAT_SRCS}) diff --git a/src/utils/geom/Triangle.cpp b/src/utils/geom/Triangle.cpp new file mode 100644 index 000000000000..732f9aa01557 --- /dev/null +++ b/src/utils/geom/Triangle.cpp @@ -0,0 +1,31 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo +// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0/ +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License 2.0 are satisfied: GNU General Public License, version 2 +// or later which is available at +// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later +/****************************************************************************/ +/// @file Triangle.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2025 +/// +// A simple triangle defined in 3D +/****************************************************************************/ +#include + +#include "Triangle.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +Triangle::Triangle() {} + +/****************************************************************************/ diff --git a/src/utils/geom/Triangle.h b/src/utils/geom/Triangle.h new file mode 100644 index 000000000000..ade3bc8bb2c4 --- /dev/null +++ b/src/utils/geom/Triangle.h @@ -0,0 +1,40 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo +// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0/ +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License 2.0 are satisfied: GNU General Public License, version 2 +// or later which is available at +// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later +/****************************************************************************/ +/// @file Triangle.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2025 +/// +// A simple triangle defined in 3D +/****************************************************************************/ +#pragma once +#include + +#include "Position.h" + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class Triangle + * @brief A simple triangle defined in 3D + */ +class Triangle { + +public: + /// @brief Constructor. Creates an empty position vector + Triangle(); + +private: + +}; From 4a990e786eaeaca51c5027a846b5cd3833493107 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Fri, 17 Jan 2025 16:35:36 +0100 Subject: [PATCH 015/116] Updated Triangle. Refs #15844 --- src/utils/geom/Triangle.cpp | 96 ++++++++++++++++++++++++++++++++++++- src/utils/geom/Triangle.h | 42 +++++++++++++++- 2 files changed, 135 insertions(+), 3 deletions(-) diff --git a/src/utils/geom/Triangle.cpp b/src/utils/geom/Triangle.cpp index 732f9aa01557..1bc320e7a547 100644 --- a/src/utils/geom/Triangle.cpp +++ b/src/utils/geom/Triangle.cpp @@ -1,4 +1,4 @@ -/****************************************************************************/ +/****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo // Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. // This program and the accompanying materials are made available under the @@ -28,4 +28,98 @@ Triangle::Triangle() {} + +Triangle::Triangle(const Position &positionA, const Position &positionB, const Position &positionC) : + myA(positionA), + myB(positionB), + myC(positionC) { + myArea = calculateTriangleArea2D(myA, myB, myC); +} + + +Triangle::~Triangle() {} + + +bool +Triangle::isAround(const Position &pos) const { + if (myArea == -1) { + return false; + } else { + const double areaPAB = calculateTriangleArea2D(pos, myA, myB); + const double areaPBC = calculateTriangleArea2D(pos, myB, myC); + const double areaPCA = calculateTriangleArea2D(pos, myC, myA); + // Check if the sum of the areas matches the total area of ​​the triangle + return std::abs(myArea - (areaPAB + areaPBC + areaPCA)) < 1e-9; + } +} + + +std::vector +Triangle::triangulate(const PositionVector& shape) { + std::vector triangles; + // check that shape has at least three positions + if (shape.size() < 3) { + return triangles; + } else { + PositionVector remainingPoints = shape; + // greedy algorithm + while (remainingPoints.size() > 3) { + const int numRemainingPoints = (int)remainingPoints.size(); + for (int i = 0; i < numRemainingPoints; i++) { + int prevIndex = (i - 1 + numRemainingPoints) % numRemainingPoints; + int nextIndex = (i + 1) % numRemainingPoints; + // get previous, current and next point + const Position& previousPoint = remainingPoints[prevIndex]; + const Position& currentPoint = remainingPoints[i]; + const Position& nextPoint = remainingPoints[nextIndex]; + // check that the vertex is an "ear" + if (isLeft(currentPoint, previousPoint, nextPoint)) { + bool isEar = true; + for (int j = 0; j < numRemainingPoints; j++) { + if (j != i && j != prevIndex && j != nextIndex) { + if (isInsideTriangle2D(remainingPoints[j], previousPoint, currentPoint, nextPoint)) { + isEar = false; + break; + } + } + } + if (isEar) { + triangles.push_back(Triangle(previousPoint, currentPoint, nextPoint)); + remainingPoints.erase(remainingPoints.begin() + i); + break; + } + } + } + } + // insert the last triangle + if (remainingPoints.size() == 3) { + triangles.push_back(Triangle(remainingPoints[0], remainingPoints[1], remainingPoints[2])); + } + return triangles; + } +} + + +bool +Triangle::isLeft(const Position& p, const Position& a, const Position& b) { + return ((b.x() - a.x()) * (p.y() - a.y())) > ((b.y() - a.y()) * (p.x() - a.x())); +} + + +double +Triangle::calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) { + return std::abs((a.x() * (b.y() - c.y()) + b.x() * (c.y() - a.y()) + c.x() * (a.y() - b.y())) / 2.0); +} + + +bool +Triangle::isInsideTriangle2D(const Position& pos, const Position& a, const Position& b, const Position& c) { + const double areaABC = calculateTriangleArea2D(a, b, c); + const double areaPAB = calculateTriangleArea2D(pos, a, b); + const double areaPBC = calculateTriangleArea2D(pos, b, c); + const double areaPCA = calculateTriangleArea2D(pos, c, a); + // Check if the sum of the areas matches the total area of ​​the triangle + return std::abs(areaABC - (areaPAB + areaPBC + areaPCA)) < 1e-9; +} + /****************************************************************************/ diff --git a/src/utils/geom/Triangle.h b/src/utils/geom/Triangle.h index ade3bc8bb2c4..5133175bd714 100644 --- a/src/utils/geom/Triangle.h +++ b/src/utils/geom/Triangle.h @@ -20,7 +20,9 @@ #pragma once #include -#include "Position.h" +#include + +#include "PositionVector.h" // =========================================================================== // class definitions @@ -32,9 +34,45 @@ class Triangle { public: - /// @brief Constructor. Creates an empty position vector + /// @brief default constructor Triangle(); + /// @brief parameter constructor + Triangle(const Position &positionA, const Position &positionB, const Position &positionC); + + /// @brief destructor + ~Triangle(); + + /// @brief check if the given position is within this triangle + bool isAround(const Position &pos) const; + + // @brief triangulate using Ear Clipping algorithm + static std::vector triangulate(const PositionVector &shape); + private: + /// @name function used in triangulate function + /// @{ + + /// @brief check if point p is to the left of line ab + static bool isLeft(const Position &p, const Position &a, const Position &b); + + /// @brief calculate triangle area (2D) + static double calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) ; + + /// @brief check if the given point is whitin the triangle formed by a-b-c + static bool isInsideTriangle2D(const Position &pos, const Position &a, const Position &b, const Position &c); + + /// @} + + /// @brief first triangle position + Position myA = Position::INVALID; + + /// @brief second triangle position + Position myB = Position::INVALID; + + /// @brief third triangle position + Position myC = Position::INVALID; + /// @brief triangle Area + double myArea = -1; }; From 80a25cb9ea3195e2d45647c096b3bc30ca8acd02 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Fri, 17 Jan 2025 17:51:19 +0100 Subject: [PATCH 016/116] Updated netedit tests. Refs #3045 --- .../yes/additionals/errors.neteditcheckoutput | 916 ++++++++++++++++-- .../menu/demands/errors.neteditcheckoutput | 618 +++++++++++- .../menu/demands/exitcode.neteditcheckoutput | 1 - 3 files changed, 1478 insertions(+), 57 deletions(-) delete mode 100644 tests/netedit/basic/configs/netecfg/save/menu/demands/exitcode.neteditcheckoutput diff --git a/tests/netedit/basic/configs/netecfg/open/overwritte/yes/additionals/errors.neteditcheckoutput b/tests/netedit/basic/configs/netecfg/open/overwritte/yes/additionals/errors.neteditcheckoutput index 388e6e825861..71af8a6df879 100644 --- a/tests/netedit/basic/configs/netecfg/open/overwritte/yes/additionals/errors.neteditcheckoutput +++ b/tests/netedit/basic/configs/netecfg/open/overwritte/yes/additionals/errors.neteditcheckoutput @@ -8,205 +8,1013 @@ Warning: Vaporizers are deprecated. Use rerouters instead. Warning: Vaporizers are deprecated. Use rerouters instead. Warning: Vaporizers are deprecated. Use rerouters instead. Warning: Vaporizers are deprecated. Use rerouters instead. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_2' without entering it, time=4.00. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_2' without entering it, time=4.00. +Warning: Vehicle 't_2' left e3Detector 'e3_0' without entering it, time=4.00. +Warning: Vehicle 't_2' left e3Detector 'e3_0' without entering it, time=4.00. +Warning: Vehicle 't_2' left e3Detector 'e3_0' without entering it, time=4.00. +Warning: Vehicle 't_2' left e3Detector 'e3_0' without entering it, time=4.00. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_2' without entering it, time=5.00. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_2' without entering it, time=5.00. Warning: Vehicle 'v_0' arrived inside e3Detector 'e3_3', time=6.00. Warning: Vehicle 'v_0' arrived inside e3Detector 'e3_0', time=6.00. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_3' without entering it, time=6.00. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_3' without entering it, time=6.00. Warning: Vehicle 'f_3.0' arrived inside e3Detector 'e3_1', time=6.00. Warning: Vehicle 'f_3.0' arrived inside e3Detector 'e3_2', time=6.00. -Warning: Vehicle 'f_3.1' arrived inside e3Detector 'e3_1', time=42.00. -Warning: Vehicle 'f_3.1' arrived inside e3Detector 'e3_2', time=42.00. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_3' without entering it, time=7.00. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_3' without entering it, time=7.00. +Warning: Vehicle 't_2' left e3Detector 'e3_1' without entering it, time=7.00. +Warning: Vehicle 't_2' left e3Detector 'e3_1' without entering it, time=7.00. +Warning: Vehicle 't_2' left e3Detector 'e3_1' without entering it, time=7.00. +Warning: Vehicle 't_2' left e3Detector 'e3_1' without entering it, time=7.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_2' without entering it, time=40.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_2' without entering it, time=40.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_2' without entering it, time=40.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_2' without entering it, time=40.00. +Warning: Vehicle 'f_3.1' arrived inside e3Detector 'e3_1', time=41.00. +Warning: Vehicle 'f_3.1' arrived inside e3Detector 'e3_2', time=41.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_3' without entering it, time=42.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_3' without entering it, time=42.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_3' without entering it, time=43.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_3' without entering it, time=43.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_2' without entering it, time=77.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_2' without entering it, time=77.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_2' without entering it, time=77.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_2' without entering it, time=77.00. Warning: Vehicle 'f_3.2' arrived inside e3Detector 'e3_1', time=78.00. Warning: Vehicle 'f_3.2' arrived inside e3Detector 'e3_2', time=78.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_3' without entering it, time=80.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_3' without entering it, time=80.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_3' without entering it, time=80.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_3' without entering it, time=80.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_2' without entering it, time=112.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_2' without entering it, time=112.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_2' without entering it, time=112.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_2' without entering it, time=112.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_3' without entering it, time=114.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_3' without entering it, time=114.00. Warning: Vehicle 'f_3.3' arrived inside e3Detector 'e3_1', time=114.00. Warning: Vehicle 'f_3.3' arrived inside e3Detector 'e3_2', time=114.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_3' without entering it, time=115.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_3' without entering it, time=115.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_2' without entering it, time=148.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_2' without entering it, time=148.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_2' without entering it, time=148.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_2' without entering it, time=148.00. Warning: Vehicle 'f_3.4' arrived inside e3Detector 'e3_1', time=150.00. Warning: Vehicle 'f_3.4' arrived inside e3Detector 'e3_2', time=150.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_3' without entering it, time=150.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_3' without entering it, time=150.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_3' without entering it, time=151.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_3' without entering it, time=151.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_2' without entering it, time=184.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_2' without entering it, time=184.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_2' without entering it, time=185.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_2' without entering it, time=185.00. Warning: Vehicle 'f_3.5' arrived inside e3Detector 'e3_1', time=186.00. Warning: Vehicle 'f_3.5' arrived inside e3Detector 'e3_2', time=186.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_3' without entering it, time=187.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_3' without entering it, time=187.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_3' without entering it, time=187.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_3' without entering it, time=187.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_2' without entering it, time=220.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_2' without entering it, time=220.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_2' without entering it, time=220.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_2' without entering it, time=220.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_3' without entering it, time=222.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_3' without entering it, time=222.00. Warning: Vehicle 'f_3.6' arrived inside e3Detector 'e3_1', time=222.00. Warning: Vehicle 'f_3.6' arrived inside e3Detector 'e3_2', time=222.00. -Warning: Vehicle 'f_3.7' arrived inside e3Detector 'e3_1', time=258.00. -Warning: Vehicle 'f_3.7' arrived inside e3Detector 'e3_2', time=258.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_3' without entering it, time=223.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_3' without entering it, time=223.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_2' without entering it, time=257.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_2' without entering it, time=257.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_2' without entering it, time=257.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_2' without entering it, time=257.00. +Warning: Vehicle 'f_3.7' arrived inside e3Detector 'e3_1', time=259.00. +Warning: Vehicle 'f_3.7' arrived inside e3Detector 'e3_2', time=259.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_3' without entering it, time=259.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_3' without entering it, time=259.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_3' without entering it, time=260.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_3' without entering it, time=260.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_2' without entering it, time=292.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_2' without entering it, time=292.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_2' without entering it, time=292.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_2' without entering it, time=292.00. Warning: Vehicle 'f_3.8' arrived inside e3Detector 'e3_1', time=294.00. Warning: Vehicle 'f_3.8' arrived inside e3Detector 'e3_2', time=294.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_3' without entering it, time=294.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_3' without entering it, time=294.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_3' without entering it, time=295.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_3' without entering it, time=295.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_2' without entering it, time=328.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_2' without entering it, time=328.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_2' without entering it, time=329.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_2' without entering it, time=329.00. Warning: Vehicle 'f_3.9' arrived inside e3Detector 'e3_1', time=330.00. Warning: Vehicle 'f_3.9' arrived inside e3Detector 'e3_2', time=330.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_3' without entering it, time=331.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_3' without entering it, time=331.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_3' without entering it, time=331.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_3' without entering it, time=331.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_2' without entering it, time=364.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_2' without entering it, time=364.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_2' without entering it, time=364.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_2' without entering it, time=364.00. Warning: Vehicle 'f_3.10' arrived inside e3Detector 'e3_1', time=366.00. Warning: Vehicle 'f_3.10' arrived inside e3Detector 'e3_2', time=366.00. -Warning: Vehicle 'f_3.11' arrived inside e3Detector 'e3_1', time=401.00. -Warning: Vehicle 'f_3.11' arrived inside e3Detector 'e3_2', time=401.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_3' without entering it, time=367.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_3' without entering it, time=367.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_3' without entering it, time=367.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_3' without entering it, time=367.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_2' without entering it, time=400.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_2' without entering it, time=400.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_2' without entering it, time=400.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_2' without entering it, time=400.00. +Warning: Vehicle 'f_3.11' arrived inside e3Detector 'e3_1', time=402.00. +Warning: Vehicle 'f_3.11' arrived inside e3Detector 'e3_2', time=402.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_3' without entering it, time=402.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_3' without entering it, time=402.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_3' without entering it, time=403.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_3' without entering it, time=403.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_2' without entering it, time=437.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_2' without entering it, time=437.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_2' without entering it, time=437.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_2' without entering it, time=437.00. Warning: Vehicle 'f_3.12' arrived inside e3Detector 'e3_1', time=438.00. Warning: Vehicle 'f_3.12' arrived inside e3Detector 'e3_2', time=438.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_3' without entering it, time=439.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_3' without entering it, time=439.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_3' without entering it, time=440.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_3' without entering it, time=440.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_2' without entering it, time=472.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_2' without entering it, time=472.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_2' without entering it, time=472.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_2' without entering it, time=472.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_3' without entering it, time=474.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_3' without entering it, time=474.00. Warning: Vehicle 'f_3.13' arrived inside e3Detector 'e3_1', time=474.00. Warning: Vehicle 'f_3.13' arrived inside e3Detector 'e3_2', time=474.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_3' without entering it, time=475.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_3' without entering it, time=475.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_2' without entering it, time=508.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_2' without entering it, time=508.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_2' without entering it, time=508.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_2' without entering it, time=508.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_3' without entering it, time=510.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_3' without entering it, time=510.00. Warning: Vehicle 'f_3.14' arrived inside e3Detector 'e3_1', time=510.00. Warning: Vehicle 'f_3.14' arrived inside e3Detector 'e3_2', time=510.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_3' without entering it, time=511.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_3' without entering it, time=511.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_2' without entering it, time=544.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_2' without entering it, time=544.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_2' without entering it, time=544.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_2' without entering it, time=544.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_3' without entering it, time=546.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_3' without entering it, time=546.00. Warning: Vehicle 'f_3.15' arrived inside e3Detector 'e3_1', time=546.00. Warning: Vehicle 'f_3.15' arrived inside e3Detector 'e3_2', time=546.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_3' without entering it, time=547.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_3' without entering it, time=547.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_2' without entering it, time=580.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_2' without entering it, time=580.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_2' without entering it, time=581.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_2' without entering it, time=581.00. Warning: Vehicle 'f_3.16' arrived inside e3Detector 'e3_1', time=582.00. Warning: Vehicle 'f_3.16' arrived inside e3Detector 'e3_2', time=582.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_3' without entering it, time=583.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_3' without entering it, time=583.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_3' without entering it, time=583.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_3' without entering it, time=583.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_2' without entering it, time=616.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_2' without entering it, time=616.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_2' without entering it, time=617.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_2' without entering it, time=617.00. Warning: Vehicle 'f_3.17' arrived inside e3Detector 'e3_1', time=618.00. Warning: Vehicle 'f_3.17' arrived inside e3Detector 'e3_2', time=618.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_3' without entering it, time=619.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_3' without entering it, time=619.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_3' without entering it, time=619.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_3' without entering it, time=619.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_2' without entering it, time=652.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_2' without entering it, time=652.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_2' without entering it, time=652.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_2' without entering it, time=652.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_3' without entering it, time=654.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_3' without entering it, time=654.00. Warning: Vehicle 'f_3.18' arrived inside e3Detector 'e3_1', time=654.00. Warning: Vehicle 'f_3.18' arrived inside e3Detector 'e3_2', time=654.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_3' without entering it, time=655.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_3' without entering it, time=655.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_2' without entering it, time=688.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_2' without entering it, time=688.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_2' without entering it, time=689.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_2' without entering it, time=689.00. Warning: Vehicle 'f_3.19' arrived inside e3Detector 'e3_1', time=690.00. Warning: Vehicle 'f_3.19' arrived inside e3Detector 'e3_2', time=690.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_3' without entering it, time=690.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_3' without entering it, time=690.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_3' without entering it, time=691.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_3' without entering it, time=691.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_2' without entering it, time=725.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_2' without entering it, time=725.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_2' without entering it, time=725.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_2' without entering it, time=725.00. Warning: Vehicle 'f_3.20' arrived inside e3Detector 'e3_1', time=726.00. Warning: Vehicle 'f_3.20' arrived inside e3Detector 'e3_2', time=726.00. -Warning: Vehicle 'f_3.21' arrived inside e3Detector 'e3_1', time=762.00. -Warning: Vehicle 'f_3.21' arrived inside e3Detector 'e3_2', time=762.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_3' without entering it, time=728.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_3' without entering it, time=728.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_3' without entering it, time=728.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_3' without entering it, time=728.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_2' without entering it, time=760.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_2' without entering it, time=760.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_2' without entering it, time=760.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_2' without entering it, time=760.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_3' without entering it, time=762.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_3' without entering it, time=762.00. +Warning: Vehicle 'f_3.21' arrived inside e3Detector 'e3_1', time=763.00. +Warning: Vehicle 'f_3.21' arrived inside e3Detector 'e3_2', time=763.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_3' without entering it, time=763.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_3' without entering it, time=763.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_2' without entering it, time=797.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_2' without entering it, time=797.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_2' without entering it, time=797.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_2' without entering it, time=797.00. Warning: Vehicle 'f_3.22' arrived inside e3Detector 'e3_1', time=798.00. Warning: Vehicle 'f_3.22' arrived inside e3Detector 'e3_2', time=798.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_3' without entering it, time=799.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_3' without entering it, time=799.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_3' without entering it, time=800.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_3' without entering it, time=800.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_2' without entering it, time=832.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_2' without entering it, time=832.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_2' without entering it, time=832.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_2' without entering it, time=832.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_3' without entering it, time=834.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_3' without entering it, time=834.00. Warning: Vehicle 'f_3.23' arrived inside e3Detector 'e3_1', time=834.00. Warning: Vehicle 'f_3.23' arrived inside e3Detector 'e3_2', time=834.00. -Warning: Vehicle 'f_3.24' arrived inside e3Detector 'e3_1', time=869.00. -Warning: Vehicle 'f_3.24' arrived inside e3Detector 'e3_2', time=869.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_3' without entering it, time=835.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_3' without entering it, time=835.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_2' without entering it, time=868.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_2' without entering it, time=868.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_2' without entering it, time=868.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_2' without entering it, time=868.00. +Warning: Vehicle 'f_3.24' arrived inside e3Detector 'e3_1', time=870.00. +Warning: Vehicle 'f_3.24' arrived inside e3Detector 'e3_2', time=870.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_3' without entering it, time=870.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_3' without entering it, time=870.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_3' without entering it, time=871.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_3' without entering it, time=871.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_2' without entering it, time=904.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_2' without entering it, time=904.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_2' without entering it, time=904.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_2' without entering it, time=904.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_3' without entering it, time=906.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_3' without entering it, time=906.00. Warning: Vehicle 'f_3.25' arrived inside e3Detector 'e3_1', time=906.00. Warning: Vehicle 'f_3.25' arrived inside e3Detector 'e3_2', time=906.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_3' without entering it, time=907.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_3' without entering it, time=907.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_2' without entering it, time=940.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_2' without entering it, time=940.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_2' without entering it, time=940.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_2' without entering it, time=940.00. Warning: Vehicle 'f_3.26' arrived inside e3Detector 'e3_1', time=942.00. Warning: Vehicle 'f_3.26' arrived inside e3Detector 'e3_2', time=942.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_3' without entering it, time=942.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_3' without entering it, time=942.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_3' without entering it, time=943.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_3' without entering it, time=943.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_2' without entering it, time=977.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_2' without entering it, time=977.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_2' without entering it, time=977.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_2' without entering it, time=977.00. Warning: Vehicle 'f_3.27' arrived inside e3Detector 'e3_1', time=978.00. Warning: Vehicle 'f_3.27' arrived inside e3Detector 'e3_2', time=978.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_3' without entering it, time=979.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_3' without entering it, time=979.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_3' without entering it, time=980.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_3' without entering it, time=980.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_2' without entering it, time=1012.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_2' without entering it, time=1012.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_2' without entering it, time=1013.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_2' without entering it, time=1013.00. Warning: Vehicle 'f_3.28' arrived inside e3Detector 'e3_1', time=1014.00. Warning: Vehicle 'f_3.28' arrived inside e3Detector 'e3_2', time=1014.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_3' without entering it, time=1014.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_3' without entering it, time=1014.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_3' without entering it, time=1015.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_3' without entering it, time=1015.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_2' without entering it, time=1049.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_2' without entering it, time=1049.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_2' without entering it, time=1049.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_2' without entering it, time=1049.00. Warning: Vehicle 'f_3.29' arrived inside e3Detector 'e3_1', time=1050.00. Warning: Vehicle 'f_3.29' arrived inside e3Detector 'e3_2', time=1050.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_3' without entering it, time=1051.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_3' without entering it, time=1051.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_3' without entering it, time=1052.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_3' without entering it, time=1052.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_2' without entering it, time=1084.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_2' without entering it, time=1084.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_2' without entering it, time=1084.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_2' without entering it, time=1084.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_3' without entering it, time=1086.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_3' without entering it, time=1086.00. Warning: Vehicle 'f_3.30' arrived inside e3Detector 'e3_1', time=1086.00. Warning: Vehicle 'f_3.30' arrived inside e3Detector 'e3_2', time=1086.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_3' without entering it, time=1087.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_3' without entering it, time=1087.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_2' without entering it, time=1120.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_2' without entering it, time=1120.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_2' without entering it, time=1120.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_2' without entering it, time=1120.00. Warning: Vehicle 'f_3.31' arrived inside e3Detector 'e3_1', time=1122.00. Warning: Vehicle 'f_3.31' arrived inside e3Detector 'e3_2', time=1122.00. -Warning: Vehicle 'f_3.32' arrived inside e3Detector 'e3_1', time=1158.00. -Warning: Vehicle 'f_3.32' arrived inside e3Detector 'e3_2', time=1158.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_3' without entering it, time=1123.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_3' without entering it, time=1123.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_3' without entering it, time=1123.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_3' without entering it, time=1123.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_2' without entering it, time=1156.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_2' without entering it, time=1156.00. +Warning: Vehicle 'f_3.32' arrived inside e3Detector 'e3_1', time=1157.00. +Warning: Vehicle 'f_3.32' arrived inside e3Detector 'e3_2', time=1157.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_2' without entering it, time=1157.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_2' without entering it, time=1157.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_3' without entering it, time=1159.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_3' without entering it, time=1159.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_3' without entering it, time=1159.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_3' without entering it, time=1159.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_2' without entering it, time=1193.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_2' without entering it, time=1193.00. Warning: Vehicle 'f_3.33' arrived inside e3Detector 'e3_1', time=1194.00. Warning: Vehicle 'f_3.33' arrived inside e3Detector 'e3_2', time=1194.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_2' without entering it, time=1194.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_2' without entering it, time=1194.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_3' without entering it, time=1196.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_3' without entering it, time=1196.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_3' without entering it, time=1196.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_3' without entering it, time=1196.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_2' without entering it, time=1228.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_2' without entering it, time=1228.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_2' without entering it, time=1229.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_2' without entering it, time=1229.00. Warning: Vehicle 'f_3.34' arrived inside e3Detector 'e3_1', time=1230.00. Warning: Vehicle 'f_3.34' arrived inside e3Detector 'e3_2', time=1230.00. -Warning: Vehicle 'f_3.35' arrived inside e3Detector 'e3_1', time=1266.00. -Warning: Vehicle 'f_3.35' arrived inside e3Detector 'e3_2', time=1266.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_3' without entering it, time=1231.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_3' without entering it, time=1231.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_3' without entering it, time=1231.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_3' without entering it, time=1231.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_2' without entering it, time=1264.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_2' without entering it, time=1264.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_2' without entering it, time=1265.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_2' without entering it, time=1265.00. +Warning: Vehicle 'f_3.35' arrived inside e3Detector 'e3_1', time=1267.00. +Warning: Vehicle 'f_3.35' arrived inside e3Detector 'e3_2', time=1267.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_3' without entering it, time=1267.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_3' without entering it, time=1267.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_3' without entering it, time=1267.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_3' without entering it, time=1267.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_2' without entering it, time=1300.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_2' without entering it, time=1300.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_2' without entering it, time=1300.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_2' without entering it, time=1300.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_3' without entering it, time=1302.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_3' without entering it, time=1302.00. Warning: Vehicle 'f_3.36' arrived inside e3Detector 'e3_1', time=1302.00. Warning: Vehicle 'f_3.36' arrived inside e3Detector 'e3_2', time=1302.00. -Warning: Vehicle 'f_3.37' arrived inside e3Detector 'e3_1', time=1339.00. -Warning: Vehicle 'f_3.37' arrived inside e3Detector 'e3_2', time=1339.00. -Warning: Vehicle 'f_3.38' arrived inside e3Detector 'e3_1', time=1375.00. -Warning: Vehicle 'f_3.38' arrived inside e3Detector 'e3_2', time=1375.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_3' without entering it, time=1303.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_3' without entering it, time=1303.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_2' without entering it, time=1336.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_2' without entering it, time=1336.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_2' without entering it, time=1337.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_2' without entering it, time=1337.00. +Warning: Vehicle 'f_3.37' arrived inside e3Detector 'e3_1', time=1338.00. +Warning: Vehicle 'f_3.37' arrived inside e3Detector 'e3_2', time=1338.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_3' without entering it, time=1339.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_3' without entering it, time=1339.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_3' without entering it, time=1340.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_3' without entering it, time=1340.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_2' without entering it, time=1372.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_2' without entering it, time=1372.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_2' without entering it, time=1373.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_2' without entering it, time=1373.00. +Warning: Vehicle 'f_3.38' arrived inside e3Detector 'e3_1', time=1374.00. +Warning: Vehicle 'f_3.38' arrived inside e3Detector 'e3_2', time=1374.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_3' without entering it, time=1375.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_3' without entering it, time=1375.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_3' without entering it, time=1375.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_3' without entering it, time=1375.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_2' without entering it, time=1408.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_2' without entering it, time=1408.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_2' without entering it, time=1409.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_2' without entering it, time=1409.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_3' without entering it, time=1410.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_3' without entering it, time=1410.00. Warning: Vehicle 'f_3.39' arrived inside e3Detector 'e3_1', time=1410.00. Warning: Vehicle 'f_3.39' arrived inside e3Detector 'e3_2', time=1410.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_3' without entering it, time=1411.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_3' without entering it, time=1411.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_2' without entering it, time=1444.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_2' without entering it, time=1444.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_2' without entering it, time=1445.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_2' without entering it, time=1445.00. Warning: Vehicle 'f_3.40' arrived inside e3Detector 'e3_1', time=1446.00. Warning: Vehicle 'f_3.40' arrived inside e3Detector 'e3_2', time=1446.00. -Warning: Vehicle 'f_3.41' arrived inside e3Detector 'e3_1', time=1483.00. -Warning: Vehicle 'f_3.41' arrived inside e3Detector 'e3_2', time=1483.00. -Warning: Vehicle 'f_3.42' arrived inside e3Detector 'e3_1', time=1518.00. -Warning: Vehicle 'f_3.42' arrived inside e3Detector 'e3_2', time=1518.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_3' without entering it, time=1447.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_3' without entering it, time=1447.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_3' without entering it, time=1448.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_3' without entering it, time=1448.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_2' without entering it, time=1480.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_2' without entering it, time=1480.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_2' without entering it, time=1480.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_2' without entering it, time=1480.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_3' without entering it, time=1482.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_3' without entering it, time=1482.00. +Warning: Vehicle 'f_3.41' arrived inside e3Detector 'e3_1', time=1482.00. +Warning: Vehicle 'f_3.41' arrived inside e3Detector 'e3_2', time=1482.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_3' without entering it, time=1483.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_3' without entering it, time=1483.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_2' without entering it, time=1516.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_2' without entering it, time=1516.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_2' without entering it, time=1516.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_2' without entering it, time=1516.00. +Warning: Vehicle 'f_3.42' arrived inside e3Detector 'e3_1', time=1517.00. +Warning: Vehicle 'f_3.42' arrived inside e3Detector 'e3_2', time=1517.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_3' without entering it, time=1518.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_3' without entering it, time=1518.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_3' without entering it, time=1519.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_3' without entering it, time=1519.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_2' without entering it, time=1552.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_2' without entering it, time=1552.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_2' without entering it, time=1553.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_2' without entering it, time=1553.00. Warning: Vehicle 'f_3.43' arrived inside e3Detector 'e3_1', time=1554.00. Warning: Vehicle 'f_3.43' arrived inside e3Detector 'e3_2', time=1554.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_3' without entering it, time=1555.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_3' without entering it, time=1555.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_3' without entering it, time=1556.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_3' without entering it, time=1556.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_2' without entering it, time=1588.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_2' without entering it, time=1588.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_2' without entering it, time=1589.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_2' without entering it, time=1589.00. Warning: Vehicle 'f_3.44' arrived inside e3Detector 'e3_1', time=1590.00. Warning: Vehicle 'f_3.44' arrived inside e3Detector 'e3_2', time=1590.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_3' without entering it, time=1591.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_3' without entering it, time=1591.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_3' without entering it, time=1591.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_3' without entering it, time=1591.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_2' without entering it, time=1625.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_2' without entering it, time=1625.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_2' without entering it, time=1625.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_2' without entering it, time=1625.00. Warning: Vehicle 'f_3.45' arrived inside e3Detector 'e3_1', time=1626.00. Warning: Vehicle 'f_3.45' arrived inside e3Detector 'e3_2', time=1626.00. -Warning: Vehicle 'f_3.46' arrived inside e3Detector 'e3_1', time=1662.00. -Warning: Vehicle 'f_3.46' arrived inside e3Detector 'e3_2', time=1662.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_3' without entering it, time=1627.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_3' without entering it, time=1627.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_3' without entering it, time=1628.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_3' without entering it, time=1628.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_2' without entering it, time=1661.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_2' without entering it, time=1661.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_2' without entering it, time=1661.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_2' without entering it, time=1661.00. +Warning: Vehicle 'f_3.46' arrived inside e3Detector 'e3_1', time=1661.00. +Warning: Vehicle 'f_3.46' arrived inside e3Detector 'e3_2', time=1661.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_3' without entering it, time=1664.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_3' without entering it, time=1664.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_3' without entering it, time=1664.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_3' without entering it, time=1664.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_2' without entering it, time=1696.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_2' without entering it, time=1696.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_2' without entering it, time=1696.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_2' without entering it, time=1696.00. Warning: Vehicle 'f_3.47' arrived inside e3Detector 'e3_1', time=1698.00. Warning: Vehicle 'f_3.47' arrived inside e3Detector 'e3_2', time=1698.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_3' without entering it, time=1699.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_3' without entering it, time=1699.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_3' without entering it, time=1699.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_3' without entering it, time=1699.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_2' without entering it, time=1732.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_2' without entering it, time=1732.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_2' without entering it, time=1733.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_2' without entering it, time=1733.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_3' without entering it, time=1734.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_3' without entering it, time=1734.00. Warning: Vehicle 'f_3.48' arrived inside e3Detector 'e3_1', time=1734.00. Warning: Vehicle 'f_3.48' arrived inside e3Detector 'e3_2', time=1734.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_3' without entering it, time=1735.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_3' without entering it, time=1735.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_2' without entering it, time=1768.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_2' without entering it, time=1768.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_2' without entering it, time=1768.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_2' without entering it, time=1768.00. Warning: Vehicle 'f_3.49' arrived inside e3Detector 'e3_1', time=1770.00. Warning: Vehicle 'f_3.49' arrived inside e3Detector 'e3_2', time=1770.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_3' without entering it, time=1770.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_3' without entering it, time=1770.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_3' without entering it, time=1771.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_3' without entering it, time=1771.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_2' without entering it, time=1804.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_2' without entering it, time=1804.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_2' without entering it, time=1805.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_2' without entering it, time=1805.00. Warning: Vehicle 'f_3.50' arrived inside e3Detector 'e3_1', time=1806.00. Warning: Vehicle 'f_3.50' arrived inside e3Detector 'e3_2', time=1806.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_3' without entering it, time=1807.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_3' without entering it, time=1807.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_3' without entering it, time=1807.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_3' without entering it, time=1807.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_2' without entering it, time=1840.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_2' without entering it, time=1840.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_2' without entering it, time=1841.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_2' without entering it, time=1841.00. Warning: Vehicle 'f_3.51' arrived inside e3Detector 'e3_1', time=1842.00. Warning: Vehicle 'f_3.51' arrived inside e3Detector 'e3_2', time=1842.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_3' without entering it, time=1843.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_3' without entering it, time=1843.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_3' without entering it, time=1844.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_3' without entering it, time=1844.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_2' without entering it, time=1877.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_2' without entering it, time=1877.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_2' without entering it, time=1877.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_2' without entering it, time=1877.00. Warning: Vehicle 'f_3.52' arrived inside e3Detector 'e3_1', time=1878.00. Warning: Vehicle 'f_3.52' arrived inside e3Detector 'e3_2', time=1878.00. -Warning: Vehicle 'f_3.53' arrived inside e3Detector 'e3_1', time=1913.00. -Warning: Vehicle 'f_3.53' arrived inside e3Detector 'e3_2', time=1913.00. -Warning: Vehicle 'f_3.54' arrived inside e3Detector 'e3_1', time=1951.00. -Warning: Vehicle 'f_3.54' arrived inside e3Detector 'e3_2', time=1951.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_3' without entering it, time=1879.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_3' without entering it, time=1879.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_3' without entering it, time=1880.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_3' without entering it, time=1880.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_2' without entering it, time=1912.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_2' without entering it, time=1912.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_2' without entering it, time=1913.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_2' without entering it, time=1913.00. +Warning: Vehicle 'f_3.53' arrived inside e3Detector 'e3_1', time=1914.00. +Warning: Vehicle 'f_3.53' arrived inside e3Detector 'e3_2', time=1914.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_3' without entering it, time=1915.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_3' without entering it, time=1915.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_3' without entering it, time=1916.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_3' without entering it, time=1916.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_2' without entering it, time=1949.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_2' without entering it, time=1949.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_2' without entering it, time=1949.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_2' without entering it, time=1949.00. +Warning: Vehicle 'f_3.54' arrived inside e3Detector 'e3_1', time=1950.00. +Warning: Vehicle 'f_3.54' arrived inside e3Detector 'e3_2', time=1950.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_3' without entering it, time=1951.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_3' without entering it, time=1951.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_3' without entering it, time=1952.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_3' without entering it, time=1952.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_2' without entering it, time=1984.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_2' without entering it, time=1984.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_2' without entering it, time=1984.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_2' without entering it, time=1984.00. Warning: Vehicle 'f_3.55' arrived inside e3Detector 'e3_1', time=1986.00. Warning: Vehicle 'f_3.55' arrived inside e3Detector 'e3_2', time=1986.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_3' without entering it, time=1986.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_3' without entering it, time=1986.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_3' without entering it, time=1987.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_3' without entering it, time=1987.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_2' without entering it, time=2020.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_2' without entering it, time=2020.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_2' without entering it, time=2021.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_2' without entering it, time=2021.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_3' without entering it, time=2022.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_3' without entering it, time=2022.00. Warning: Vehicle 'f_3.56' arrived inside e3Detector 'e3_1', time=2022.00. Warning: Vehicle 'f_3.56' arrived inside e3Detector 'e3_2', time=2022.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_3' without entering it, time=2023.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_3' without entering it, time=2023.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_2' without entering it, time=2056.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_2' without entering it, time=2056.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_2' without entering it, time=2056.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_2' without entering it, time=2056.00. Warning: Vehicle 'f_3.57' arrived inside e3Detector 'e3_1', time=2058.00. Warning: Vehicle 'f_3.57' arrived inside e3Detector 'e3_2', time=2058.00. -Warning: Vehicle 'f_3.58' arrived inside e3Detector 'e3_1', time=2093.00. -Warning: Vehicle 'f_3.58' arrived inside e3Detector 'e3_2', time=2093.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_3' without entering it, time=2058.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_3' without entering it, time=2058.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_3' without entering it, time=2059.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_3' without entering it, time=2059.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_2' without entering it, time=2092.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_2' without entering it, time=2092.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_2' without entering it, time=2092.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_2' without entering it, time=2092.00. +Warning: Vehicle 'f_3.58' arrived inside e3Detector 'e3_1', time=2094.00. +Warning: Vehicle 'f_3.58' arrived inside e3Detector 'e3_2', time=2094.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_3' without entering it, time=2094.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_3' without entering it, time=2094.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_3' without entering it, time=2095.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_3' without entering it, time=2095.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_2' without entering it, time=2128.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_2' without entering it, time=2128.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_2' without entering it, time=2129.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_2' without entering it, time=2129.00. Warning: Vehicle 'f_3.59' arrived inside e3Detector 'e3_1', time=2130.00. Warning: Vehicle 'f_3.59' arrived inside e3Detector 'e3_2', time=2130.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_3' without entering it, time=2130.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_3' without entering it, time=2130.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_3' without entering it, time=2131.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_3' without entering it, time=2131.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_2' without entering it, time=2164.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_2' without entering it, time=2164.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_2' without entering it, time=2165.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_2' without entering it, time=2165.00. Warning: Vehicle 'f_3.60' arrived inside e3Detector 'e3_1', time=2166.00. Warning: Vehicle 'f_3.60' arrived inside e3Detector 'e3_2', time=2166.00. -Warning: Vehicle 'f_3.61' arrived inside e3Detector 'e3_1', time=2203.00. -Warning: Vehicle 'f_3.61' arrived inside e3Detector 'e3_2', time=2203.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_3' without entering it, time=2167.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_3' without entering it, time=2167.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_3' without entering it, time=2168.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_3' without entering it, time=2168.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_2' without entering it, time=2200.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_2' without entering it, time=2200.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_2' without entering it, time=2201.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_2' without entering it, time=2201.00. +Warning: Vehicle 'f_3.61' arrived inside e3Detector 'e3_1', time=2202.00. +Warning: Vehicle 'f_3.61' arrived inside e3Detector 'e3_2', time=2202.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_3' without entering it, time=2203.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_3' without entering it, time=2203.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_3' without entering it, time=2204.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_3' without entering it, time=2204.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_2' without entering it, time=2236.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_2' without entering it, time=2236.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_2' without entering it, time=2237.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_2' without entering it, time=2237.00. Warning: Vehicle 'f_3.62' arrived inside e3Detector 'e3_1', time=2238.00. Warning: Vehicle 'f_3.62' arrived inside e3Detector 'e3_2', time=2238.00. -Warning: Vehicle 'f_3.63' arrived inside e3Detector 'e3_1', time=2275.00. -Warning: Vehicle 'f_3.63' arrived inside e3Detector 'e3_2', time=2275.00. -Warning: Vehicle 'f_3.64' arrived inside e3Detector 'e3_1', time=2311.00. -Warning: Vehicle 'f_3.64' arrived inside e3Detector 'e3_2', time=2311.00. -Warning: Vehicle 'f_3.65' arrived inside e3Detector 'e3_1', time=2346.00. -Warning: Vehicle 'f_3.65' arrived inside e3Detector 'e3_2', time=2346.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_3' without entering it, time=2240.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_3' without entering it, time=2240.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_3' without entering it, time=2240.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_3' without entering it, time=2240.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_2' without entering it, time=2272.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_2' without entering it, time=2272.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_2' without entering it, time=2272.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_2' without entering it, time=2272.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_3' without entering it, time=2274.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_3' without entering it, time=2274.00. +Warning: Vehicle 'f_3.63' arrived inside e3Detector 'e3_1', time=2274.00. +Warning: Vehicle 'f_3.63' arrived inside e3Detector 'e3_2', time=2274.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_3' without entering it, time=2275.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_3' without entering it, time=2275.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_2' without entering it, time=2308.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_2' without entering it, time=2308.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_2' without entering it, time=2309.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_2' without entering it, time=2309.00. +Warning: Vehicle 'f_3.64' arrived inside e3Detector 'e3_1', time=2310.00. +Warning: Vehicle 'f_3.64' arrived inside e3Detector 'e3_2', time=2310.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_3' without entering it, time=2311.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_3' without entering it, time=2311.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_3' without entering it, time=2312.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_3' without entering it, time=2312.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_2' without entering it, time=2344.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_2' without entering it, time=2344.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_2' without entering it, time=2345.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_2' without entering it, time=2345.00. +Warning: Vehicle 'f_3.65' arrived inside e3Detector 'e3_1', time=2347.00. +Warning: Vehicle 'f_3.65' arrived inside e3Detector 'e3_2', time=2347.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_3' without entering it, time=2347.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_3' without entering it, time=2347.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_3' without entering it, time=2347.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_3' without entering it, time=2347.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_2' without entering it, time=2381.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_2' without entering it, time=2381.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_2' without entering it, time=2381.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_2' without entering it, time=2381.00. Warning: Vehicle 'f_3.66' arrived inside e3Detector 'e3_1', time=2382.00. Warning: Vehicle 'f_3.66' arrived inside e3Detector 'e3_2', time=2382.00. -Warning: Vehicle 'f_3.67' arrived inside e3Detector 'e3_1', time=2419.00. -Warning: Vehicle 'f_3.67' arrived inside e3Detector 'e3_2', time=2419.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_3' without entering it, time=2383.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_3' without entering it, time=2383.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_3' without entering it, time=2384.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_3' without entering it, time=2384.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_2' without entering it, time=2417.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_2' without entering it, time=2417.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_2' without entering it, time=2417.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_2' without entering it, time=2417.00. +Warning: Vehicle 'f_3.67' arrived inside e3Detector 'e3_1', time=2418.00. +Warning: Vehicle 'f_3.67' arrived inside e3Detector 'e3_2', time=2418.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_3' without entering it, time=2419.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_3' without entering it, time=2419.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_3' without entering it, time=2420.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_3' without entering it, time=2420.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_2' without entering it, time=2452.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_2' without entering it, time=2452.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_2' without entering it, time=2453.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_2' without entering it, time=2453.00. Warning: Vehicle 'f_3.68' arrived inside e3Detector 'e3_1', time=2454.00. Warning: Vehicle 'f_3.68' arrived inside e3Detector 'e3_2', time=2454.00. -Warning: Vehicle 'f_3.69' arrived inside e3Detector 'e3_1', time=2490.00. -Warning: Vehicle 'f_3.69' arrived inside e3Detector 'e3_2', time=2490.00. -Warning: Vehicle 'f_3.70' arrived inside e3Detector 'e3_1', time=2526.00. -Warning: Vehicle 'f_3.70' arrived inside e3Detector 'e3_2', time=2526.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_3' without entering it, time=2455.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_3' without entering it, time=2455.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_3' without entering it, time=2456.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_3' without entering it, time=2456.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_2' without entering it, time=2488.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_2' without entering it, time=2488.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_2' without entering it, time=2489.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_2' without entering it, time=2489.00. +Warning: Vehicle 'f_3.69' arrived inside e3Detector 'e3_1', time=2491.00. +Warning: Vehicle 'f_3.69' arrived inside e3Detector 'e3_2', time=2491.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_3' without entering it, time=2491.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_3' without entering it, time=2491.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_3' without entering it, time=2492.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_3' without entering it, time=2492.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_2' without entering it, time=2525.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_2' without entering it, time=2525.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_2' without entering it, time=2525.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_2' without entering it, time=2525.00. +Warning: Vehicle 'f_3.70' arrived inside e3Detector 'e3_1', time=2527.00. +Warning: Vehicle 'f_3.70' arrived inside e3Detector 'e3_2', time=2527.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_3' without entering it, time=2528.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_3' without entering it, time=2528.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_3' without entering it, time=2529.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_3' without entering it, time=2529.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_2' without entering it, time=2560.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_2' without entering it, time=2560.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_2' without entering it, time=2561.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_2' without entering it, time=2561.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_3' without entering it, time=2562.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_3' without entering it, time=2562.00. Warning: Vehicle 'f_3.71' arrived inside e3Detector 'e3_1', time=2562.00. Warning: Vehicle 'f_3.71' arrived inside e3Detector 'e3_2', time=2562.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_3' without entering it, time=2563.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_3' without entering it, time=2563.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_2' without entering it, time=2596.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_2' without entering it, time=2596.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_2' without entering it, time=2597.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_2' without entering it, time=2597.00. Warning: Vehicle 'f_3.72' arrived inside e3Detector 'e3_1', time=2598.00. Warning: Vehicle 'f_3.72' arrived inside e3Detector 'e3_2', time=2598.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_3' without entering it, time=2599.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_3' without entering it, time=2599.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_3' without entering it, time=2599.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_3' without entering it, time=2599.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_2' without entering it, time=2632.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_2' without entering it, time=2632.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_2' without entering it, time=2632.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_2' without entering it, time=2632.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_3' without entering it, time=2634.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_3' without entering it, time=2634.00. Warning: Vehicle 'f_3.73' arrived inside e3Detector 'e3_1', time=2634.00. Warning: Vehicle 'f_3.73' arrived inside e3Detector 'e3_2', time=2634.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_3' without entering it, time=2635.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_3' without entering it, time=2635.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_2' without entering it, time=2668.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_2' without entering it, time=2668.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_2' without entering it, time=2669.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_2' without entering it, time=2669.00. Warning: Vehicle 'f_3.74' arrived inside e3Detector 'e3_1', time=2670.00. Warning: Vehicle 'f_3.74' arrived inside e3Detector 'e3_2', time=2670.00. -Warning: Vehicle 'f_3.75' arrived inside e3Detector 'e3_1', time=2707.00. -Warning: Vehicle 'f_3.75' arrived inside e3Detector 'e3_2', time=2707.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_3' without entering it, time=2671.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_3' without entering it, time=2671.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_3' without entering it, time=2672.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_3' without entering it, time=2672.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_2' without entering it, time=2705.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_2' without entering it, time=2705.00. +Warning: Vehicle 'f_3.75' arrived inside e3Detector 'e3_1', time=2706.00. +Warning: Vehicle 'f_3.75' arrived inside e3Detector 'e3_2', time=2706.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_2' without entering it, time=2706.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_2' without entering it, time=2706.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_3' without entering it, time=2708.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_3' without entering it, time=2708.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_3' without entering it, time=2708.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_3' without entering it, time=2708.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_2' without entering it, time=2740.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_2' without entering it, time=2740.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_2' without entering it, time=2741.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_2' without entering it, time=2741.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_3' without entering it, time=2742.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_3' without entering it, time=2742.00. Warning: Vehicle 'f_3.76' arrived inside e3Detector 'e3_1', time=2742.00. Warning: Vehicle 'f_3.76' arrived inside e3Detector 'e3_2', time=2742.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_3' without entering it, time=2743.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_3' without entering it, time=2743.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_2' without entering it, time=2777.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_2' without entering it, time=2777.00. Warning: Vehicle 'f_3.77' arrived inside e3Detector 'e3_1', time=2778.00. Warning: Vehicle 'f_3.77' arrived inside e3Detector 'e3_2', time=2778.00. -Warning: Vehicle 'f_3.78' arrived inside e3Detector 'e3_1', time=2814.00. -Warning: Vehicle 'f_3.78' arrived inside e3Detector 'e3_2', time=2814.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_2' without entering it, time=2778.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_2' without entering it, time=2778.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_3' without entering it, time=2780.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_3' without entering it, time=2780.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_3' without entering it, time=2780.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_3' without entering it, time=2780.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_2' without entering it, time=2812.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_2' without entering it, time=2812.00. +Warning: Vehicle 'f_3.78' arrived inside e3Detector 'e3_1', time=2813.00. +Warning: Vehicle 'f_3.78' arrived inside e3Detector 'e3_2', time=2813.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_2' without entering it, time=2813.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_2' without entering it, time=2813.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_3' without entering it, time=2814.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_3' without entering it, time=2814.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_3' without entering it, time=2815.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_3' without entering it, time=2815.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_2' without entering it, time=2848.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_2' without entering it, time=2848.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_2' without entering it, time=2849.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_2' without entering it, time=2849.00. Warning: Vehicle 'f_3.79' arrived inside e3Detector 'e3_1', time=2850.00. Warning: Vehicle 'f_3.79' arrived inside e3Detector 'e3_2', time=2850.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_3' without entering it, time=2851.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_3' without entering it, time=2851.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_3' without entering it, time=2852.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_3' without entering it, time=2852.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_2' without entering it, time=2884.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_2' without entering it, time=2884.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_2' without entering it, time=2884.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_2' without entering it, time=2884.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_3' without entering it, time=2886.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_3' without entering it, time=2886.00. Warning: Vehicle 'f_3.80' arrived inside e3Detector 'e3_1', time=2886.00. Warning: Vehicle 'f_3.80' arrived inside e3Detector 'e3_2', time=2886.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_3' without entering it, time=2887.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_3' without entering it, time=2887.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_2' without entering it, time=2920.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_2' without entering it, time=2920.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_2' without entering it, time=2921.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_2' without entering it, time=2921.00. Warning: Vehicle 'f_3.81' arrived inside e3Detector 'e3_1', time=2922.00. Warning: Vehicle 'f_3.81' arrived inside e3Detector 'e3_2', time=2922.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_3' without entering it, time=2922.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_3' without entering it, time=2922.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_3' without entering it, time=2923.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_3' without entering it, time=2923.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_2' without entering it, time=2956.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_2' without entering it, time=2956.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_2' without entering it, time=2956.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_2' without entering it, time=2956.00. Warning: Vehicle 'f_3.82' arrived inside e3Detector 'e3_1', time=2958.00. Warning: Vehicle 'f_3.82' arrived inside e3Detector 'e3_2', time=2958.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_3' without entering it, time=2958.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_3' without entering it, time=2958.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_3' without entering it, time=2959.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_3' without entering it, time=2959.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_2' without entering it, time=2992.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_2' without entering it, time=2992.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_2' without entering it, time=2992.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_2' without entering it, time=2992.00. Warning: Vehicle 'f_3.83' arrived inside e3Detector 'e3_1', time=2994.00. Warning: Vehicle 'f_3.83' arrived inside e3Detector 'e3_2', time=2994.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_3' without entering it, time=2995.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_3' without entering it, time=2995.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_3' without entering it, time=2995.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_3' without entering it, time=2995.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_2' without entering it, time=3028.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_2' without entering it, time=3028.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_2' without entering it, time=3028.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_2' without entering it, time=3028.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_3' without entering it, time=3030.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_3' without entering it, time=3030.00. Warning: Vehicle 'f_3.84' arrived inside e3Detector 'e3_1', time=3030.00. Warning: Vehicle 'f_3.84' arrived inside e3Detector 'e3_2', time=3030.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_3' without entering it, time=3031.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_3' without entering it, time=3031.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_2' without entering it, time=3064.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_2' without entering it, time=3064.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_2' without entering it, time=3065.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_2' without entering it, time=3065.00. Warning: Vehicle 'f_3.85' arrived inside e3Detector 'e3_1', time=3066.00. Warning: Vehicle 'f_3.85' arrived inside e3Detector 'e3_2', time=3066.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_3' without entering it, time=3067.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_3' without entering it, time=3067.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_3' without entering it, time=3067.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_3' without entering it, time=3067.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_2' without entering it, time=3101.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_2' without entering it, time=3101.00. Warning: Vehicle 'f_3.86' arrived inside e3Detector 'e3_1', time=3102.00. Warning: Vehicle 'f_3.86' arrived inside e3Detector 'e3_2', time=3102.00. -Warning: Vehicle 'f_3.87' arrived inside e3Detector 'e3_1', time=3139.00. -Warning: Vehicle 'f_3.87' arrived inside e3Detector 'e3_2', time=3139.00. -Warning: Vehicle 'f_3.88' arrived inside e3Detector 'e3_1', time=3175.00. -Warning: Vehicle 'f_3.88' arrived inside e3Detector 'e3_2', time=3175.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_2' without entering it, time=3102.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_2' without entering it, time=3102.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_3' without entering it, time=3104.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_3' without entering it, time=3104.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_3' without entering it, time=3105.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_3' without entering it, time=3105.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_2' without entering it, time=3136.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_2' without entering it, time=3136.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_2' without entering it, time=3137.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_2' without entering it, time=3137.00. +Warning: Vehicle 'f_3.87' arrived inside e3Detector 'e3_1', time=3138.00. +Warning: Vehicle 'f_3.87' arrived inside e3Detector 'e3_2', time=3138.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_3' without entering it, time=3139.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_3' without entering it, time=3139.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_3' without entering it, time=3140.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_3' without entering it, time=3140.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_2' without entering it, time=3172.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_2' without entering it, time=3172.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_2' without entering it, time=3173.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_2' without entering it, time=3173.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_3' without entering it, time=3174.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_3' without entering it, time=3174.00. +Warning: Vehicle 'f_3.88' arrived inside e3Detector 'e3_1', time=3174.00. +Warning: Vehicle 'f_3.88' arrived inside e3Detector 'e3_2', time=3174.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_3' without entering it, time=3175.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_3' without entering it, time=3175.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_2' without entering it, time=3209.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_2' without entering it, time=3209.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_2' without entering it, time=3209.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_2' without entering it, time=3209.00. Warning: Vehicle 'f_3.89' arrived inside e3Detector 'e3_1', time=3210.00. Warning: Vehicle 'f_3.89' arrived inside e3Detector 'e3_2', time=3210.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_3' without entering it, time=3212.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_3' without entering it, time=3212.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_3' without entering it, time=3213.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_3' without entering it, time=3213.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_2' without entering it, time=3245.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_2' without entering it, time=3245.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_2' without entering it, time=3245.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_2' without entering it, time=3245.00. Warning: Vehicle 'f_3.90' arrived inside e3Detector 'e3_1', time=3246.00. Warning: Vehicle 'f_3.90' arrived inside e3Detector 'e3_2', time=3246.00. -Warning: Vehicle 'f_3.91' arrived inside e3Detector 'e3_1', time=3282.00. -Warning: Vehicle 'f_3.91' arrived inside e3Detector 'e3_2', time=3282.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_3' without entering it, time=3247.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_3' without entering it, time=3247.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_3' without entering it, time=3248.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_3' without entering it, time=3248.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_2' without entering it, time=3281.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_2' without entering it, time=3281.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_2' without entering it, time=3281.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_2' without entering it, time=3281.00. +Warning: Vehicle 'f_3.91' arrived inside e3Detector 'e3_1', time=3283.00. +Warning: Vehicle 'f_3.91' arrived inside e3Detector 'e3_2', time=3283.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_3' without entering it, time=3283.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_3' without entering it, time=3283.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_3' without entering it, time=3284.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_3' without entering it, time=3284.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_2' without entering it, time=3316.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_2' without entering it, time=3316.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_2' without entering it, time=3317.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_2' without entering it, time=3317.00. Warning: Vehicle 'f_3.92' arrived inside e3Detector 'e3_1', time=3318.00. Warning: Vehicle 'f_3.92' arrived inside e3Detector 'e3_2', time=3318.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_3' without entering it, time=3319.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_3' without entering it, time=3319.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_3' without entering it, time=3320.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_3' without entering it, time=3320.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_2' without entering it, time=3353.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_2' without entering it, time=3353.00. Warning: Vehicle 'f_3.93' arrived inside e3Detector 'e3_1', time=3354.00. Warning: Vehicle 'f_3.93' arrived inside e3Detector 'e3_2', time=3354.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_2' without entering it, time=3354.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_2' without entering it, time=3354.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_3' without entering it, time=3356.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_3' without entering it, time=3356.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_3' without entering it, time=3357.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_3' without entering it, time=3357.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_2' without entering it, time=3388.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_2' without entering it, time=3388.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_2' without entering it, time=3389.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_2' without entering it, time=3389.00. Warning: Vehicle 'f_3.94' arrived inside e3Detector 'e3_1', time=3390.00. Warning: Vehicle 'f_3.94' arrived inside e3Detector 'e3_2', time=3390.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_3' without entering it, time=3391.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_3' without entering it, time=3391.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_3' without entering it, time=3392.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_3' without entering it, time=3392.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_2' without entering it, time=3425.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_2' without entering it, time=3425.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_2' without entering it, time=3425.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_2' without entering it, time=3425.00. Warning: Vehicle 'f_3.95' arrived inside e3Detector 'e3_1', time=3426.00. Warning: Vehicle 'f_3.95' arrived inside e3Detector 'e3_2', time=3426.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_3' without entering it, time=3427.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_3' without entering it, time=3427.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_3' without entering it, time=3428.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_3' without entering it, time=3428.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_2' without entering it, time=3461.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_2' without entering it, time=3461.00. Warning: Vehicle 'f_3.96' arrived inside e3Detector 'e3_1', time=3462.00. Warning: Vehicle 'f_3.96' arrived inside e3Detector 'e3_2', time=3462.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_2' without entering it, time=3462.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_2' without entering it, time=3462.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_3' without entering it, time=3464.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_3' without entering it, time=3464.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_3' without entering it, time=3464.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_3' without entering it, time=3464.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_2' without entering it, time=3496.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_2' without entering it, time=3496.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_2' without entering it, time=3497.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_2' without entering it, time=3497.00. Warning: Vehicle 'f_3.97' arrived inside e3Detector 'e3_1', time=3498.00. Warning: Vehicle 'f_3.97' arrived inside e3Detector 'e3_2', time=3498.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_3' without entering it, time=3499.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_3' without entering it, time=3499.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_3' without entering it, time=3499.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_3' without entering it, time=3499.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_2' without entering it, time=3532.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_2' without entering it, time=3532.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_2' without entering it, time=3533.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_2' without entering it, time=3533.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_3' without entering it, time=3534.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_3' without entering it, time=3534.00. Warning: Vehicle 'f_3.98' arrived inside e3Detector 'e3_1', time=3534.00. Warning: Vehicle 'f_3.98' arrived inside e3Detector 'e3_2', time=3534.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_3' without entering it, time=3535.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_3' without entering it, time=3535.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_2' without entering it, time=3569.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_2' without entering it, time=3569.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_2' without entering it, time=3569.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_2' without entering it, time=3569.00. Warning: Vehicle 'f_3.99' arrived inside e3Detector 'e3_1', time=3570.00. Warning: Vehicle 'f_3.99' arrived inside e3Detector 'e3_2', time=3570.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_3' without entering it, time=3571.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_3' without entering it, time=3571.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_3' without entering it, time=3572.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_3' without entering it, time=3572.00. diff --git a/tests/netedit/basic/configs/netecfg/save/menu/demands/errors.neteditcheckoutput b/tests/netedit/basic/configs/netecfg/save/menu/demands/errors.neteditcheckoutput index 0cc2397fa705..f5141ad25ff8 100644 --- a/tests/netedit/basic/configs/netecfg/save/menu/demands/errors.neteditcheckoutput +++ b/tests/netedit/basic/configs/netecfg/save/menu/demands/errors.neteditcheckoutput @@ -1,2 +1,616 @@ -Error: File 'net.netedit' is not accessible (No such file or directory). -Quitting (on error). +Warning: No flow intervals in calibrator 'ca_0'. +Warning: No flow intervals in calibrator 'ca_1'. +Warning: No flow intervals in calibrator 'ca_2'. +Warning: No flow intervals in calibrator 'ca_3'. +Warning: No flow intervals in calibrator 'ca_5'. +Warning: No flow intervals in calibrator 'ca_6'. +Warning: Vaporizers are deprecated. Use rerouters instead. +Warning: Vaporizers are deprecated. Use rerouters instead. +Warning: Vaporizers are deprecated. Use rerouters instead. +Warning: Vaporizers are deprecated. Use rerouters instead. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_2' without entering it, time=4.00. +Warning: Vehicle 't_2' left e3Detector 'e3_0' without entering it, time=4.00. +Warning: Vehicle 't_2' left e3Detector 'e3_0' without entering it, time=4.00. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_2' without entering it, time=5.00. +Warning: Vehicle 'v_0' arrived inside e3Detector 'e3_3', time=6.00. +Warning: Vehicle 'v_0' arrived inside e3Detector 'e3_0', time=6.00. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_3' without entering it, time=6.00. +Warning: Vehicle 'f_3.0' arrived inside e3Detector 'e3_1', time=6.00. +Warning: Vehicle 'f_3.0' arrived inside e3Detector 'e3_2', time=6.00. +Warning: Vehicle 'f_2.0' left e3Detector 'e3_3' without entering it, time=7.00. +Warning: Vehicle 't_2' left e3Detector 'e3_1' without entering it, time=7.00. +Warning: Vehicle 't_2' left e3Detector 'e3_1' without entering it, time=7.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_2' without entering it, time=40.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_2' without entering it, time=40.00. +Warning: Vehicle 'f_3.1' arrived inside e3Detector 'e3_1', time=41.00. +Warning: Vehicle 'f_3.1' arrived inside e3Detector 'e3_2', time=41.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_3' without entering it, time=42.00. +Warning: Vehicle 'f_2.1' left e3Detector 'e3_3' without entering it, time=43.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_2' without entering it, time=77.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_2' without entering it, time=77.00. +Warning: Vehicle 'f_3.2' arrived inside e3Detector 'e3_1', time=78.00. +Warning: Vehicle 'f_3.2' arrived inside e3Detector 'e3_2', time=78.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_3' without entering it, time=80.00. +Warning: Vehicle 'f_2.2' left e3Detector 'e3_3' without entering it, time=80.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_2' without entering it, time=112.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_2' without entering it, time=112.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_3' without entering it, time=114.00. +Warning: Vehicle 'f_3.3' arrived inside e3Detector 'e3_1', time=114.00. +Warning: Vehicle 'f_3.3' arrived inside e3Detector 'e3_2', time=114.00. +Warning: Vehicle 'f_2.3' left e3Detector 'e3_3' without entering it, time=115.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_2' without entering it, time=148.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_2' without entering it, time=148.00. +Warning: Vehicle 'f_3.4' arrived inside e3Detector 'e3_1', time=150.00. +Warning: Vehicle 'f_3.4' arrived inside e3Detector 'e3_2', time=150.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_3' without entering it, time=150.00. +Warning: Vehicle 'f_2.4' left e3Detector 'e3_3' without entering it, time=151.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_2' without entering it, time=184.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_2' without entering it, time=185.00. +Warning: Vehicle 'f_3.5' arrived inside e3Detector 'e3_1', time=186.00. +Warning: Vehicle 'f_3.5' arrived inside e3Detector 'e3_2', time=186.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_3' without entering it, time=187.00. +Warning: Vehicle 'f_2.5' left e3Detector 'e3_3' without entering it, time=187.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_2' without entering it, time=220.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_2' without entering it, time=220.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_3' without entering it, time=222.00. +Warning: Vehicle 'f_3.6' arrived inside e3Detector 'e3_1', time=222.00. +Warning: Vehicle 'f_3.6' arrived inside e3Detector 'e3_2', time=222.00. +Warning: Vehicle 'f_2.6' left e3Detector 'e3_3' without entering it, time=223.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_2' without entering it, time=257.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_2' without entering it, time=257.00. +Warning: Vehicle 'f_3.7' arrived inside e3Detector 'e3_1', time=259.00. +Warning: Vehicle 'f_3.7' arrived inside e3Detector 'e3_2', time=259.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_3' without entering it, time=259.00. +Warning: Vehicle 'f_2.7' left e3Detector 'e3_3' without entering it, time=260.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_2' without entering it, time=292.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_2' without entering it, time=292.00. +Warning: Vehicle 'f_3.8' arrived inside e3Detector 'e3_1', time=294.00. +Warning: Vehicle 'f_3.8' arrived inside e3Detector 'e3_2', time=294.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_3' without entering it, time=294.00. +Warning: Vehicle 'f_2.8' left e3Detector 'e3_3' without entering it, time=295.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_2' without entering it, time=328.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_2' without entering it, time=329.00. +Warning: Vehicle 'f_3.9' arrived inside e3Detector 'e3_1', time=330.00. +Warning: Vehicle 'f_3.9' arrived inside e3Detector 'e3_2', time=330.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_3' without entering it, time=331.00. +Warning: Vehicle 'f_2.9' left e3Detector 'e3_3' without entering it, time=331.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_2' without entering it, time=364.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_2' without entering it, time=364.00. +Warning: Vehicle 'f_3.10' arrived inside e3Detector 'e3_1', time=366.00. +Warning: Vehicle 'f_3.10' arrived inside e3Detector 'e3_2', time=366.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_3' without entering it, time=367.00. +Warning: Vehicle 'f_2.10' left e3Detector 'e3_3' without entering it, time=367.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_2' without entering it, time=400.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_2' without entering it, time=400.00. +Warning: Vehicle 'f_3.11' arrived inside e3Detector 'e3_1', time=402.00. +Warning: Vehicle 'f_3.11' arrived inside e3Detector 'e3_2', time=402.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_3' without entering it, time=402.00. +Warning: Vehicle 'f_2.11' left e3Detector 'e3_3' without entering it, time=403.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_2' without entering it, time=437.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_2' without entering it, time=437.00. +Warning: Vehicle 'f_3.12' arrived inside e3Detector 'e3_1', time=438.00. +Warning: Vehicle 'f_3.12' arrived inside e3Detector 'e3_2', time=438.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_3' without entering it, time=439.00. +Warning: Vehicle 'f_2.12' left e3Detector 'e3_3' without entering it, time=440.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_2' without entering it, time=472.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_2' without entering it, time=472.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_3' without entering it, time=474.00. +Warning: Vehicle 'f_3.13' arrived inside e3Detector 'e3_1', time=474.00. +Warning: Vehicle 'f_3.13' arrived inside e3Detector 'e3_2', time=474.00. +Warning: Vehicle 'f_2.13' left e3Detector 'e3_3' without entering it, time=475.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_2' without entering it, time=508.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_2' without entering it, time=508.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_3' without entering it, time=510.00. +Warning: Vehicle 'f_3.14' arrived inside e3Detector 'e3_1', time=510.00. +Warning: Vehicle 'f_3.14' arrived inside e3Detector 'e3_2', time=510.00. +Warning: Vehicle 'f_2.14' left e3Detector 'e3_3' without entering it, time=511.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_2' without entering it, time=544.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_2' without entering it, time=544.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_3' without entering it, time=546.00. +Warning: Vehicle 'f_3.15' arrived inside e3Detector 'e3_1', time=546.00. +Warning: Vehicle 'f_3.15' arrived inside e3Detector 'e3_2', time=546.00. +Warning: Vehicle 'f_2.15' left e3Detector 'e3_3' without entering it, time=547.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_2' without entering it, time=580.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_2' without entering it, time=581.00. +Warning: Vehicle 'f_3.16' arrived inside e3Detector 'e3_1', time=582.00. +Warning: Vehicle 'f_3.16' arrived inside e3Detector 'e3_2', time=582.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_3' without entering it, time=583.00. +Warning: Vehicle 'f_2.16' left e3Detector 'e3_3' without entering it, time=583.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_2' without entering it, time=616.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_2' without entering it, time=617.00. +Warning: Vehicle 'f_3.17' arrived inside e3Detector 'e3_1', time=618.00. +Warning: Vehicle 'f_3.17' arrived inside e3Detector 'e3_2', time=618.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_3' without entering it, time=619.00. +Warning: Vehicle 'f_2.17' left e3Detector 'e3_3' without entering it, time=619.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_2' without entering it, time=652.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_2' without entering it, time=652.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_3' without entering it, time=654.00. +Warning: Vehicle 'f_3.18' arrived inside e3Detector 'e3_1', time=654.00. +Warning: Vehicle 'f_3.18' arrived inside e3Detector 'e3_2', time=654.00. +Warning: Vehicle 'f_2.18' left e3Detector 'e3_3' without entering it, time=655.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_2' without entering it, time=688.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_2' without entering it, time=689.00. +Warning: Vehicle 'f_3.19' arrived inside e3Detector 'e3_1', time=690.00. +Warning: Vehicle 'f_3.19' arrived inside e3Detector 'e3_2', time=690.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_3' without entering it, time=690.00. +Warning: Vehicle 'f_2.19' left e3Detector 'e3_3' without entering it, time=691.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_2' without entering it, time=725.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_2' without entering it, time=725.00. +Warning: Vehicle 'f_3.20' arrived inside e3Detector 'e3_1', time=726.00. +Warning: Vehicle 'f_3.20' arrived inside e3Detector 'e3_2', time=726.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_3' without entering it, time=728.00. +Warning: Vehicle 'f_2.20' left e3Detector 'e3_3' without entering it, time=728.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_2' without entering it, time=760.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_2' without entering it, time=760.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_3' without entering it, time=762.00. +Warning: Vehicle 'f_3.21' arrived inside e3Detector 'e3_1', time=763.00. +Warning: Vehicle 'f_3.21' arrived inside e3Detector 'e3_2', time=763.00. +Warning: Vehicle 'f_2.21' left e3Detector 'e3_3' without entering it, time=763.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_2' without entering it, time=797.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_2' without entering it, time=797.00. +Warning: Vehicle 'f_3.22' arrived inside e3Detector 'e3_1', time=798.00. +Warning: Vehicle 'f_3.22' arrived inside e3Detector 'e3_2', time=798.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_3' without entering it, time=799.00. +Warning: Vehicle 'f_2.22' left e3Detector 'e3_3' without entering it, time=800.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_2' without entering it, time=832.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_2' without entering it, time=832.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_3' without entering it, time=834.00. +Warning: Vehicle 'f_3.23' arrived inside e3Detector 'e3_1', time=834.00. +Warning: Vehicle 'f_3.23' arrived inside e3Detector 'e3_2', time=834.00. +Warning: Vehicle 'f_2.23' left e3Detector 'e3_3' without entering it, time=835.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_2' without entering it, time=868.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_2' without entering it, time=868.00. +Warning: Vehicle 'f_3.24' arrived inside e3Detector 'e3_1', time=870.00. +Warning: Vehicle 'f_3.24' arrived inside e3Detector 'e3_2', time=870.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_3' without entering it, time=870.00. +Warning: Vehicle 'f_2.24' left e3Detector 'e3_3' without entering it, time=871.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_2' without entering it, time=904.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_2' without entering it, time=904.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_3' without entering it, time=906.00. +Warning: Vehicle 'f_3.25' arrived inside e3Detector 'e3_1', time=906.00. +Warning: Vehicle 'f_3.25' arrived inside e3Detector 'e3_2', time=906.00. +Warning: Vehicle 'f_2.25' left e3Detector 'e3_3' without entering it, time=907.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_2' without entering it, time=940.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_2' without entering it, time=940.00. +Warning: Vehicle 'f_3.26' arrived inside e3Detector 'e3_1', time=942.00. +Warning: Vehicle 'f_3.26' arrived inside e3Detector 'e3_2', time=942.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_3' without entering it, time=942.00. +Warning: Vehicle 'f_2.26' left e3Detector 'e3_3' without entering it, time=943.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_2' without entering it, time=977.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_2' without entering it, time=977.00. +Warning: Vehicle 'f_3.27' arrived inside e3Detector 'e3_1', time=978.00. +Warning: Vehicle 'f_3.27' arrived inside e3Detector 'e3_2', time=978.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_3' without entering it, time=979.00. +Warning: Vehicle 'f_2.27' left e3Detector 'e3_3' without entering it, time=980.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_2' without entering it, time=1012.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_2' without entering it, time=1013.00. +Warning: Vehicle 'f_3.28' arrived inside e3Detector 'e3_1', time=1014.00. +Warning: Vehicle 'f_3.28' arrived inside e3Detector 'e3_2', time=1014.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_3' without entering it, time=1014.00. +Warning: Vehicle 'f_2.28' left e3Detector 'e3_3' without entering it, time=1015.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_2' without entering it, time=1049.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_2' without entering it, time=1049.00. +Warning: Vehicle 'f_3.29' arrived inside e3Detector 'e3_1', time=1050.00. +Warning: Vehicle 'f_3.29' arrived inside e3Detector 'e3_2', time=1050.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_3' without entering it, time=1051.00. +Warning: Vehicle 'f_2.29' left e3Detector 'e3_3' without entering it, time=1052.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_2' without entering it, time=1084.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_2' without entering it, time=1084.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_3' without entering it, time=1086.00. +Warning: Vehicle 'f_3.30' arrived inside e3Detector 'e3_1', time=1086.00. +Warning: Vehicle 'f_3.30' arrived inside e3Detector 'e3_2', time=1086.00. +Warning: Vehicle 'f_2.30' left e3Detector 'e3_3' without entering it, time=1087.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_2' without entering it, time=1120.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_2' without entering it, time=1120.00. +Warning: Vehicle 'f_3.31' arrived inside e3Detector 'e3_1', time=1122.00. +Warning: Vehicle 'f_3.31' arrived inside e3Detector 'e3_2', time=1122.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_3' without entering it, time=1123.00. +Warning: Vehicle 'f_2.31' left e3Detector 'e3_3' without entering it, time=1123.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_2' without entering it, time=1156.00. +Warning: Vehicle 'f_3.32' arrived inside e3Detector 'e3_1', time=1157.00. +Warning: Vehicle 'f_3.32' arrived inside e3Detector 'e3_2', time=1157.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_2' without entering it, time=1157.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_3' without entering it, time=1159.00. +Warning: Vehicle 'f_2.32' left e3Detector 'e3_3' without entering it, time=1159.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_2' without entering it, time=1193.00. +Warning: Vehicle 'f_3.33' arrived inside e3Detector 'e3_1', time=1194.00. +Warning: Vehicle 'f_3.33' arrived inside e3Detector 'e3_2', time=1194.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_2' without entering it, time=1194.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_3' without entering it, time=1196.00. +Warning: Vehicle 'f_2.33' left e3Detector 'e3_3' without entering it, time=1196.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_2' without entering it, time=1228.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_2' without entering it, time=1229.00. +Warning: Vehicle 'f_3.34' arrived inside e3Detector 'e3_1', time=1230.00. +Warning: Vehicle 'f_3.34' arrived inside e3Detector 'e3_2', time=1230.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_3' without entering it, time=1231.00. +Warning: Vehicle 'f_2.34' left e3Detector 'e3_3' without entering it, time=1231.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_2' without entering it, time=1264.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_2' without entering it, time=1265.00. +Warning: Vehicle 'f_3.35' arrived inside e3Detector 'e3_1', time=1267.00. +Warning: Vehicle 'f_3.35' arrived inside e3Detector 'e3_2', time=1267.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_3' without entering it, time=1267.00. +Warning: Vehicle 'f_2.35' left e3Detector 'e3_3' without entering it, time=1267.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_2' without entering it, time=1300.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_2' without entering it, time=1300.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_3' without entering it, time=1302.00. +Warning: Vehicle 'f_3.36' arrived inside e3Detector 'e3_1', time=1302.00. +Warning: Vehicle 'f_3.36' arrived inside e3Detector 'e3_2', time=1302.00. +Warning: Vehicle 'f_2.36' left e3Detector 'e3_3' without entering it, time=1303.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_2' without entering it, time=1336.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_2' without entering it, time=1337.00. +Warning: Vehicle 'f_3.37' arrived inside e3Detector 'e3_1', time=1338.00. +Warning: Vehicle 'f_3.37' arrived inside e3Detector 'e3_2', time=1338.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_3' without entering it, time=1339.00. +Warning: Vehicle 'f_2.37' left e3Detector 'e3_3' without entering it, time=1340.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_2' without entering it, time=1372.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_2' without entering it, time=1373.00. +Warning: Vehicle 'f_3.38' arrived inside e3Detector 'e3_1', time=1374.00. +Warning: Vehicle 'f_3.38' arrived inside e3Detector 'e3_2', time=1374.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_3' without entering it, time=1375.00. +Warning: Vehicle 'f_2.38' left e3Detector 'e3_3' without entering it, time=1375.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_2' without entering it, time=1408.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_2' without entering it, time=1409.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_3' without entering it, time=1410.00. +Warning: Vehicle 'f_3.39' arrived inside e3Detector 'e3_1', time=1410.00. +Warning: Vehicle 'f_3.39' arrived inside e3Detector 'e3_2', time=1410.00. +Warning: Vehicle 'f_2.39' left e3Detector 'e3_3' without entering it, time=1411.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_2' without entering it, time=1444.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_2' without entering it, time=1445.00. +Warning: Vehicle 'f_3.40' arrived inside e3Detector 'e3_1', time=1446.00. +Warning: Vehicle 'f_3.40' arrived inside e3Detector 'e3_2', time=1446.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_3' without entering it, time=1447.00. +Warning: Vehicle 'f_2.40' left e3Detector 'e3_3' without entering it, time=1448.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_2' without entering it, time=1480.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_2' without entering it, time=1480.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_3' without entering it, time=1482.00. +Warning: Vehicle 'f_3.41' arrived inside e3Detector 'e3_1', time=1482.00. +Warning: Vehicle 'f_3.41' arrived inside e3Detector 'e3_2', time=1482.00. +Warning: Vehicle 'f_2.41' left e3Detector 'e3_3' without entering it, time=1483.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_2' without entering it, time=1516.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_2' without entering it, time=1516.00. +Warning: Vehicle 'f_3.42' arrived inside e3Detector 'e3_1', time=1517.00. +Warning: Vehicle 'f_3.42' arrived inside e3Detector 'e3_2', time=1517.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_3' without entering it, time=1518.00. +Warning: Vehicle 'f_2.42' left e3Detector 'e3_3' without entering it, time=1519.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_2' without entering it, time=1552.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_2' without entering it, time=1553.00. +Warning: Vehicle 'f_3.43' arrived inside e3Detector 'e3_1', time=1554.00. +Warning: Vehicle 'f_3.43' arrived inside e3Detector 'e3_2', time=1554.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_3' without entering it, time=1555.00. +Warning: Vehicle 'f_2.43' left e3Detector 'e3_3' without entering it, time=1556.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_2' without entering it, time=1588.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_2' without entering it, time=1589.00. +Warning: Vehicle 'f_3.44' arrived inside e3Detector 'e3_1', time=1590.00. +Warning: Vehicle 'f_3.44' arrived inside e3Detector 'e3_2', time=1590.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_3' without entering it, time=1591.00. +Warning: Vehicle 'f_2.44' left e3Detector 'e3_3' without entering it, time=1591.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_2' without entering it, time=1625.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_2' without entering it, time=1625.00. +Warning: Vehicle 'f_3.45' arrived inside e3Detector 'e3_1', time=1626.00. +Warning: Vehicle 'f_3.45' arrived inside e3Detector 'e3_2', time=1626.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_3' without entering it, time=1627.00. +Warning: Vehicle 'f_2.45' left e3Detector 'e3_3' without entering it, time=1628.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_2' without entering it, time=1661.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_2' without entering it, time=1661.00. +Warning: Vehicle 'f_3.46' arrived inside e3Detector 'e3_1', time=1661.00. +Warning: Vehicle 'f_3.46' arrived inside e3Detector 'e3_2', time=1661.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_3' without entering it, time=1664.00. +Warning: Vehicle 'f_2.46' left e3Detector 'e3_3' without entering it, time=1664.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_2' without entering it, time=1696.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_2' without entering it, time=1696.00. +Warning: Vehicle 'f_3.47' arrived inside e3Detector 'e3_1', time=1698.00. +Warning: Vehicle 'f_3.47' arrived inside e3Detector 'e3_2', time=1698.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_3' without entering it, time=1699.00. +Warning: Vehicle 'f_2.47' left e3Detector 'e3_3' without entering it, time=1699.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_2' without entering it, time=1732.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_2' without entering it, time=1733.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_3' without entering it, time=1734.00. +Warning: Vehicle 'f_3.48' arrived inside e3Detector 'e3_1', time=1734.00. +Warning: Vehicle 'f_3.48' arrived inside e3Detector 'e3_2', time=1734.00. +Warning: Vehicle 'f_2.48' left e3Detector 'e3_3' without entering it, time=1735.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_2' without entering it, time=1768.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_2' without entering it, time=1768.00. +Warning: Vehicle 'f_3.49' arrived inside e3Detector 'e3_1', time=1770.00. +Warning: Vehicle 'f_3.49' arrived inside e3Detector 'e3_2', time=1770.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_3' without entering it, time=1770.00. +Warning: Vehicle 'f_2.49' left e3Detector 'e3_3' without entering it, time=1771.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_2' without entering it, time=1804.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_2' without entering it, time=1805.00. +Warning: Vehicle 'f_3.50' arrived inside e3Detector 'e3_1', time=1806.00. +Warning: Vehicle 'f_3.50' arrived inside e3Detector 'e3_2', time=1806.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_3' without entering it, time=1807.00. +Warning: Vehicle 'f_2.50' left e3Detector 'e3_3' without entering it, time=1807.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_2' without entering it, time=1840.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_2' without entering it, time=1841.00. +Warning: Vehicle 'f_3.51' arrived inside e3Detector 'e3_1', time=1842.00. +Warning: Vehicle 'f_3.51' arrived inside e3Detector 'e3_2', time=1842.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_3' without entering it, time=1843.00. +Warning: Vehicle 'f_2.51' left e3Detector 'e3_3' without entering it, time=1844.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_2' without entering it, time=1877.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_2' without entering it, time=1877.00. +Warning: Vehicle 'f_3.52' arrived inside e3Detector 'e3_1', time=1878.00. +Warning: Vehicle 'f_3.52' arrived inside e3Detector 'e3_2', time=1878.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_3' without entering it, time=1879.00. +Warning: Vehicle 'f_2.52' left e3Detector 'e3_3' without entering it, time=1880.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_2' without entering it, time=1912.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_2' without entering it, time=1913.00. +Warning: Vehicle 'f_3.53' arrived inside e3Detector 'e3_1', time=1914.00. +Warning: Vehicle 'f_3.53' arrived inside e3Detector 'e3_2', time=1914.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_3' without entering it, time=1915.00. +Warning: Vehicle 'f_2.53' left e3Detector 'e3_3' without entering it, time=1916.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_2' without entering it, time=1949.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_2' without entering it, time=1949.00. +Warning: Vehicle 'f_3.54' arrived inside e3Detector 'e3_1', time=1950.00. +Warning: Vehicle 'f_3.54' arrived inside e3Detector 'e3_2', time=1950.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_3' without entering it, time=1951.00. +Warning: Vehicle 'f_2.54' left e3Detector 'e3_3' without entering it, time=1952.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_2' without entering it, time=1984.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_2' without entering it, time=1984.00. +Warning: Vehicle 'f_3.55' arrived inside e3Detector 'e3_1', time=1986.00. +Warning: Vehicle 'f_3.55' arrived inside e3Detector 'e3_2', time=1986.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_3' without entering it, time=1986.00. +Warning: Vehicle 'f_2.55' left e3Detector 'e3_3' without entering it, time=1987.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_2' without entering it, time=2020.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_2' without entering it, time=2021.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_3' without entering it, time=2022.00. +Warning: Vehicle 'f_3.56' arrived inside e3Detector 'e3_1', time=2022.00. +Warning: Vehicle 'f_3.56' arrived inside e3Detector 'e3_2', time=2022.00. +Warning: Vehicle 'f_2.56' left e3Detector 'e3_3' without entering it, time=2023.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_2' without entering it, time=2056.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_2' without entering it, time=2056.00. +Warning: Vehicle 'f_3.57' arrived inside e3Detector 'e3_1', time=2058.00. +Warning: Vehicle 'f_3.57' arrived inside e3Detector 'e3_2', time=2058.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_3' without entering it, time=2058.00. +Warning: Vehicle 'f_2.57' left e3Detector 'e3_3' without entering it, time=2059.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_2' without entering it, time=2092.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_2' without entering it, time=2092.00. +Warning: Vehicle 'f_3.58' arrived inside e3Detector 'e3_1', time=2094.00. +Warning: Vehicle 'f_3.58' arrived inside e3Detector 'e3_2', time=2094.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_3' without entering it, time=2094.00. +Warning: Vehicle 'f_2.58' left e3Detector 'e3_3' without entering it, time=2095.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_2' without entering it, time=2128.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_2' without entering it, time=2129.00. +Warning: Vehicle 'f_3.59' arrived inside e3Detector 'e3_1', time=2130.00. +Warning: Vehicle 'f_3.59' arrived inside e3Detector 'e3_2', time=2130.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_3' without entering it, time=2130.00. +Warning: Vehicle 'f_2.59' left e3Detector 'e3_3' without entering it, time=2131.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_2' without entering it, time=2164.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_2' without entering it, time=2165.00. +Warning: Vehicle 'f_3.60' arrived inside e3Detector 'e3_1', time=2166.00. +Warning: Vehicle 'f_3.60' arrived inside e3Detector 'e3_2', time=2166.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_3' without entering it, time=2167.00. +Warning: Vehicle 'f_2.60' left e3Detector 'e3_3' without entering it, time=2168.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_2' without entering it, time=2200.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_2' without entering it, time=2201.00. +Warning: Vehicle 'f_3.61' arrived inside e3Detector 'e3_1', time=2202.00. +Warning: Vehicle 'f_3.61' arrived inside e3Detector 'e3_2', time=2202.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_3' without entering it, time=2203.00. +Warning: Vehicle 'f_2.61' left e3Detector 'e3_3' without entering it, time=2204.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_2' without entering it, time=2236.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_2' without entering it, time=2237.00. +Warning: Vehicle 'f_3.62' arrived inside e3Detector 'e3_1', time=2238.00. +Warning: Vehicle 'f_3.62' arrived inside e3Detector 'e3_2', time=2238.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_3' without entering it, time=2240.00. +Warning: Vehicle 'f_2.62' left e3Detector 'e3_3' without entering it, time=2240.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_2' without entering it, time=2272.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_2' without entering it, time=2272.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_3' without entering it, time=2274.00. +Warning: Vehicle 'f_3.63' arrived inside e3Detector 'e3_1', time=2274.00. +Warning: Vehicle 'f_3.63' arrived inside e3Detector 'e3_2', time=2274.00. +Warning: Vehicle 'f_2.63' left e3Detector 'e3_3' without entering it, time=2275.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_2' without entering it, time=2308.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_2' without entering it, time=2309.00. +Warning: Vehicle 'f_3.64' arrived inside e3Detector 'e3_1', time=2310.00. +Warning: Vehicle 'f_3.64' arrived inside e3Detector 'e3_2', time=2310.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_3' without entering it, time=2311.00. +Warning: Vehicle 'f_2.64' left e3Detector 'e3_3' without entering it, time=2312.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_2' without entering it, time=2344.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_2' without entering it, time=2345.00. +Warning: Vehicle 'f_3.65' arrived inside e3Detector 'e3_1', time=2347.00. +Warning: Vehicle 'f_3.65' arrived inside e3Detector 'e3_2', time=2347.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_3' without entering it, time=2347.00. +Warning: Vehicle 'f_2.65' left e3Detector 'e3_3' without entering it, time=2347.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_2' without entering it, time=2381.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_2' without entering it, time=2381.00. +Warning: Vehicle 'f_3.66' arrived inside e3Detector 'e3_1', time=2382.00. +Warning: Vehicle 'f_3.66' arrived inside e3Detector 'e3_2', time=2382.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_3' without entering it, time=2383.00. +Warning: Vehicle 'f_2.66' left e3Detector 'e3_3' without entering it, time=2384.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_2' without entering it, time=2417.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_2' without entering it, time=2417.00. +Warning: Vehicle 'f_3.67' arrived inside e3Detector 'e3_1', time=2418.00. +Warning: Vehicle 'f_3.67' arrived inside e3Detector 'e3_2', time=2418.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_3' without entering it, time=2419.00. +Warning: Vehicle 'f_2.67' left e3Detector 'e3_3' without entering it, time=2420.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_2' without entering it, time=2452.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_2' without entering it, time=2453.00. +Warning: Vehicle 'f_3.68' arrived inside e3Detector 'e3_1', time=2454.00. +Warning: Vehicle 'f_3.68' arrived inside e3Detector 'e3_2', time=2454.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_3' without entering it, time=2455.00. +Warning: Vehicle 'f_2.68' left e3Detector 'e3_3' without entering it, time=2456.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_2' without entering it, time=2488.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_2' without entering it, time=2489.00. +Warning: Vehicle 'f_3.69' arrived inside e3Detector 'e3_1', time=2491.00. +Warning: Vehicle 'f_3.69' arrived inside e3Detector 'e3_2', time=2491.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_3' without entering it, time=2491.00. +Warning: Vehicle 'f_2.69' left e3Detector 'e3_3' without entering it, time=2492.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_2' without entering it, time=2525.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_2' without entering it, time=2525.00. +Warning: Vehicle 'f_3.70' arrived inside e3Detector 'e3_1', time=2527.00. +Warning: Vehicle 'f_3.70' arrived inside e3Detector 'e3_2', time=2527.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_3' without entering it, time=2528.00. +Warning: Vehicle 'f_2.70' left e3Detector 'e3_3' without entering it, time=2529.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_2' without entering it, time=2560.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_2' without entering it, time=2561.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_3' without entering it, time=2562.00. +Warning: Vehicle 'f_3.71' arrived inside e3Detector 'e3_1', time=2562.00. +Warning: Vehicle 'f_3.71' arrived inside e3Detector 'e3_2', time=2562.00. +Warning: Vehicle 'f_2.71' left e3Detector 'e3_3' without entering it, time=2563.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_2' without entering it, time=2596.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_2' without entering it, time=2597.00. +Warning: Vehicle 'f_3.72' arrived inside e3Detector 'e3_1', time=2598.00. +Warning: Vehicle 'f_3.72' arrived inside e3Detector 'e3_2', time=2598.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_3' without entering it, time=2599.00. +Warning: Vehicle 'f_2.72' left e3Detector 'e3_3' without entering it, time=2599.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_2' without entering it, time=2632.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_2' without entering it, time=2632.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_3' without entering it, time=2634.00. +Warning: Vehicle 'f_3.73' arrived inside e3Detector 'e3_1', time=2634.00. +Warning: Vehicle 'f_3.73' arrived inside e3Detector 'e3_2', time=2634.00. +Warning: Vehicle 'f_2.73' left e3Detector 'e3_3' without entering it, time=2635.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_2' without entering it, time=2668.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_2' without entering it, time=2669.00. +Warning: Vehicle 'f_3.74' arrived inside e3Detector 'e3_1', time=2670.00. +Warning: Vehicle 'f_3.74' arrived inside e3Detector 'e3_2', time=2670.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_3' without entering it, time=2671.00. +Warning: Vehicle 'f_2.74' left e3Detector 'e3_3' without entering it, time=2672.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_2' without entering it, time=2705.00. +Warning: Vehicle 'f_3.75' arrived inside e3Detector 'e3_1', time=2706.00. +Warning: Vehicle 'f_3.75' arrived inside e3Detector 'e3_2', time=2706.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_2' without entering it, time=2706.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_3' without entering it, time=2708.00. +Warning: Vehicle 'f_2.75' left e3Detector 'e3_3' without entering it, time=2708.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_2' without entering it, time=2740.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_2' without entering it, time=2741.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_3' without entering it, time=2742.00. +Warning: Vehicle 'f_3.76' arrived inside e3Detector 'e3_1', time=2742.00. +Warning: Vehicle 'f_3.76' arrived inside e3Detector 'e3_2', time=2742.00. +Warning: Vehicle 'f_2.76' left e3Detector 'e3_3' without entering it, time=2743.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_2' without entering it, time=2777.00. +Warning: Vehicle 'f_3.77' arrived inside e3Detector 'e3_1', time=2778.00. +Warning: Vehicle 'f_3.77' arrived inside e3Detector 'e3_2', time=2778.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_2' without entering it, time=2778.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_3' without entering it, time=2780.00. +Warning: Vehicle 'f_2.77' left e3Detector 'e3_3' without entering it, time=2780.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_2' without entering it, time=2812.00. +Warning: Vehicle 'f_3.78' arrived inside e3Detector 'e3_1', time=2813.00. +Warning: Vehicle 'f_3.78' arrived inside e3Detector 'e3_2', time=2813.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_2' without entering it, time=2813.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_3' without entering it, time=2814.00. +Warning: Vehicle 'f_2.78' left e3Detector 'e3_3' without entering it, time=2815.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_2' without entering it, time=2848.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_2' without entering it, time=2849.00. +Warning: Vehicle 'f_3.79' arrived inside e3Detector 'e3_1', time=2850.00. +Warning: Vehicle 'f_3.79' arrived inside e3Detector 'e3_2', time=2850.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_3' without entering it, time=2851.00. +Warning: Vehicle 'f_2.79' left e3Detector 'e3_3' without entering it, time=2852.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_2' without entering it, time=2884.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_2' without entering it, time=2884.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_3' without entering it, time=2886.00. +Warning: Vehicle 'f_3.80' arrived inside e3Detector 'e3_1', time=2886.00. +Warning: Vehicle 'f_3.80' arrived inside e3Detector 'e3_2', time=2886.00. +Warning: Vehicle 'f_2.80' left e3Detector 'e3_3' without entering it, time=2887.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_2' without entering it, time=2920.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_2' without entering it, time=2921.00. +Warning: Vehicle 'f_3.81' arrived inside e3Detector 'e3_1', time=2922.00. +Warning: Vehicle 'f_3.81' arrived inside e3Detector 'e3_2', time=2922.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_3' without entering it, time=2922.00. +Warning: Vehicle 'f_2.81' left e3Detector 'e3_3' without entering it, time=2923.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_2' without entering it, time=2956.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_2' without entering it, time=2956.00. +Warning: Vehicle 'f_3.82' arrived inside e3Detector 'e3_1', time=2958.00. +Warning: Vehicle 'f_3.82' arrived inside e3Detector 'e3_2', time=2958.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_3' without entering it, time=2958.00. +Warning: Vehicle 'f_2.82' left e3Detector 'e3_3' without entering it, time=2959.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_2' without entering it, time=2992.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_2' without entering it, time=2992.00. +Warning: Vehicle 'f_3.83' arrived inside e3Detector 'e3_1', time=2994.00. +Warning: Vehicle 'f_3.83' arrived inside e3Detector 'e3_2', time=2994.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_3' without entering it, time=2995.00. +Warning: Vehicle 'f_2.83' left e3Detector 'e3_3' without entering it, time=2995.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_2' without entering it, time=3028.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_2' without entering it, time=3028.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_3' without entering it, time=3030.00. +Warning: Vehicle 'f_3.84' arrived inside e3Detector 'e3_1', time=3030.00. +Warning: Vehicle 'f_3.84' arrived inside e3Detector 'e3_2', time=3030.00. +Warning: Vehicle 'f_2.84' left e3Detector 'e3_3' without entering it, time=3031.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_2' without entering it, time=3064.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_2' without entering it, time=3065.00. +Warning: Vehicle 'f_3.85' arrived inside e3Detector 'e3_1', time=3066.00. +Warning: Vehicle 'f_3.85' arrived inside e3Detector 'e3_2', time=3066.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_3' without entering it, time=3067.00. +Warning: Vehicle 'f_2.85' left e3Detector 'e3_3' without entering it, time=3067.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_2' without entering it, time=3101.00. +Warning: Vehicle 'f_3.86' arrived inside e3Detector 'e3_1', time=3102.00. +Warning: Vehicle 'f_3.86' arrived inside e3Detector 'e3_2', time=3102.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_2' without entering it, time=3102.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_3' without entering it, time=3104.00. +Warning: Vehicle 'f_2.86' left e3Detector 'e3_3' without entering it, time=3105.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_2' without entering it, time=3136.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_2' without entering it, time=3137.00. +Warning: Vehicle 'f_3.87' arrived inside e3Detector 'e3_1', time=3138.00. +Warning: Vehicle 'f_3.87' arrived inside e3Detector 'e3_2', time=3138.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_3' without entering it, time=3139.00. +Warning: Vehicle 'f_2.87' left e3Detector 'e3_3' without entering it, time=3140.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_2' without entering it, time=3172.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_2' without entering it, time=3173.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_3' without entering it, time=3174.00. +Warning: Vehicle 'f_3.88' arrived inside e3Detector 'e3_1', time=3174.00. +Warning: Vehicle 'f_3.88' arrived inside e3Detector 'e3_2', time=3174.00. +Warning: Vehicle 'f_2.88' left e3Detector 'e3_3' without entering it, time=3175.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_2' without entering it, time=3209.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_2' without entering it, time=3209.00. +Warning: Vehicle 'f_3.89' arrived inside e3Detector 'e3_1', time=3210.00. +Warning: Vehicle 'f_3.89' arrived inside e3Detector 'e3_2', time=3210.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_3' without entering it, time=3212.00. +Warning: Vehicle 'f_2.89' left e3Detector 'e3_3' without entering it, time=3213.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_2' without entering it, time=3245.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_2' without entering it, time=3245.00. +Warning: Vehicle 'f_3.90' arrived inside e3Detector 'e3_1', time=3246.00. +Warning: Vehicle 'f_3.90' arrived inside e3Detector 'e3_2', time=3246.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_3' without entering it, time=3247.00. +Warning: Vehicle 'f_2.90' left e3Detector 'e3_3' without entering it, time=3248.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_2' without entering it, time=3281.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_2' without entering it, time=3281.00. +Warning: Vehicle 'f_3.91' arrived inside e3Detector 'e3_1', time=3283.00. +Warning: Vehicle 'f_3.91' arrived inside e3Detector 'e3_2', time=3283.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_3' without entering it, time=3283.00. +Warning: Vehicle 'f_2.91' left e3Detector 'e3_3' without entering it, time=3284.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_2' without entering it, time=3316.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_2' without entering it, time=3317.00. +Warning: Vehicle 'f_3.92' arrived inside e3Detector 'e3_1', time=3318.00. +Warning: Vehicle 'f_3.92' arrived inside e3Detector 'e3_2', time=3318.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_3' without entering it, time=3319.00. +Warning: Vehicle 'f_2.92' left e3Detector 'e3_3' without entering it, time=3320.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_2' without entering it, time=3353.00. +Warning: Vehicle 'f_3.93' arrived inside e3Detector 'e3_1', time=3354.00. +Warning: Vehicle 'f_3.93' arrived inside e3Detector 'e3_2', time=3354.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_2' without entering it, time=3354.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_3' without entering it, time=3356.00. +Warning: Vehicle 'f_2.93' left e3Detector 'e3_3' without entering it, time=3357.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_2' without entering it, time=3388.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_2' without entering it, time=3389.00. +Warning: Vehicle 'f_3.94' arrived inside e3Detector 'e3_1', time=3390.00. +Warning: Vehicle 'f_3.94' arrived inside e3Detector 'e3_2', time=3390.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_3' without entering it, time=3391.00. +Warning: Vehicle 'f_2.94' left e3Detector 'e3_3' without entering it, time=3392.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_2' without entering it, time=3425.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_2' without entering it, time=3425.00. +Warning: Vehicle 'f_3.95' arrived inside e3Detector 'e3_1', time=3426.00. +Warning: Vehicle 'f_3.95' arrived inside e3Detector 'e3_2', time=3426.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_3' without entering it, time=3427.00. +Warning: Vehicle 'f_2.95' left e3Detector 'e3_3' without entering it, time=3428.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_2' without entering it, time=3461.00. +Warning: Vehicle 'f_3.96' arrived inside e3Detector 'e3_1', time=3462.00. +Warning: Vehicle 'f_3.96' arrived inside e3Detector 'e3_2', time=3462.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_2' without entering it, time=3462.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_3' without entering it, time=3464.00. +Warning: Vehicle 'f_2.96' left e3Detector 'e3_3' without entering it, time=3464.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_2' without entering it, time=3496.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_2' without entering it, time=3497.00. +Warning: Vehicle 'f_3.97' arrived inside e3Detector 'e3_1', time=3498.00. +Warning: Vehicle 'f_3.97' arrived inside e3Detector 'e3_2', time=3498.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_3' without entering it, time=3499.00. +Warning: Vehicle 'f_2.97' left e3Detector 'e3_3' without entering it, time=3499.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_2' without entering it, time=3532.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_2' without entering it, time=3533.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_3' without entering it, time=3534.00. +Warning: Vehicle 'f_3.98' arrived inside e3Detector 'e3_1', time=3534.00. +Warning: Vehicle 'f_3.98' arrived inside e3Detector 'e3_2', time=3534.00. +Warning: Vehicle 'f_2.98' left e3Detector 'e3_3' without entering it, time=3535.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_2' without entering it, time=3569.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_2' without entering it, time=3569.00. +Warning: Vehicle 'f_3.99' arrived inside e3Detector 'e3_1', time=3570.00. +Warning: Vehicle 'f_3.99' arrived inside e3Detector 'e3_2', time=3570.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_3' without entering it, time=3571.00. +Warning: Vehicle 'f_2.99' left e3Detector 'e3_3' without entering it, time=3572.00. diff --git a/tests/netedit/basic/configs/netecfg/save/menu/demands/exitcode.neteditcheckoutput b/tests/netedit/basic/configs/netecfg/save/menu/demands/exitcode.neteditcheckoutput deleted file mode 100644 index d00491fd7e5b..000000000000 --- a/tests/netedit/basic/configs/netecfg/save/menu/demands/exitcode.neteditcheckoutput +++ /dev/null @@ -1 +0,0 @@ -1 From 9c90c4dba30c10e65f0de8d9ac7bdfb48b66b799 Mon Sep 17 00:00:00 2001 From: Michael Behrisch Date: Sat, 18 Jan 2025 08:21:15 +0100 Subject: [PATCH 017/116] fixing style #22 --- src/utils/geom/Triangle.cpp | 8 ++++---- tests/netedit/attributesEnum.py | 1 + tests/netedit/viewPositions.py | 10 ++++++++++ tools/countEdgeUsage.py | 2 +- tools/district/filterDistricts.py | 2 +- tools/route/geoTrip2POI.py | 20 ++++++++++---------- tools/sumolib/statistics.py | 2 +- 7 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/utils/geom/Triangle.cpp b/src/utils/geom/Triangle.cpp index 1bc320e7a547..8d7b8f3455ed 100644 --- a/src/utils/geom/Triangle.cpp +++ b/src/utils/geom/Triangle.cpp @@ -1,4 +1,4 @@ -/****************************************************************************/ +/****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo // Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. // This program and the accompanying materials are made available under the @@ -29,7 +29,7 @@ Triangle::Triangle() {} -Triangle::Triangle(const Position &positionA, const Position &positionB, const Position &positionC) : +Triangle::Triangle(const Position& positionA, const Position& positionB, const Position& positionC) : myA(positionA), myB(positionB), myC(positionC) { @@ -41,14 +41,14 @@ Triangle::~Triangle() {} bool -Triangle::isAround(const Position &pos) const { +Triangle::isAround(const Position& pos) const { if (myArea == -1) { return false; } else { const double areaPAB = calculateTriangleArea2D(pos, myA, myB); const double areaPBC = calculateTriangleArea2D(pos, myB, myC); const double areaPCA = calculateTriangleArea2D(pos, myC, myA); - // Check if the sum of the areas matches the total area of ​​the triangle + // Check if the sum of the areas matches the total area of the triangle return std::abs(myArea - (areaPAB + areaPBC + areaPCA)) < 1e-9; } } diff --git a/tests/netedit/attributesEnum.py b/tests/netedit/attributesEnum.py index 382e83b7b728..e7d6499273f0 100644 --- a/tests/netedit/attributesEnum.py +++ b/tests/netedit/attributesEnum.py @@ -35,6 +35,7 @@ class file: saveJoinedJunctions = 11 reloadConfig = 12 reloadNetwork = 13 + class neteditConfig: menu = 14 save = 1 diff --git a/tests/netedit/viewPositions.py b/tests/netedit/viewPositions.py index 87019b17a1c9..1f47c7dc3eed 100644 --- a/tests/netedit/viewPositions.py +++ b/tests/netedit/viewPositions.py @@ -25,21 +25,29 @@ class tmp: y = 0 # reference position + + class reference: x = 0 y = 0 # down-left position (to avoid missclicks with toolbar menus) + + class downLeft: x = 950 y = 470 # extern lane bot (common for all tests) + + class externLaneBot: x = 42 y = 332 # extern lane Top (common for all tests) + + class externLaneTop: x = 42 y = 136 @@ -50,6 +58,8 @@ class overlappedTest: y = 218 # network + + class selection: class edge: diff --git a/tools/countEdgeUsage.py b/tools/countEdgeUsage.py index 2778ad242c55..bb0bd6629416 100755 --- a/tools/countEdgeUsage.py +++ b/tools/countEdgeUsage.py @@ -174,7 +174,7 @@ def writeInterval(outf, options, departCounts, arrivalCounts, intermediateCounts arrivalStats.add(arrivalCounts[e], e) if options.verbose: print("Loaded %s routes" % sum(departCounts.values())) - + print(departStats) print(arrivalStats) if options.intermediate: diff --git a/tools/district/filterDistricts.py b/tools/district/filterDistricts.py index cd9bf824acb5..baacca59dc72 100755 --- a/tools/district/filterDistricts.py +++ b/tools/district/filterDistricts.py @@ -18,7 +18,7 @@ """ Filters a TAZ file for edges that exist in the given net -and optionally +and optionally - keep edges that permit a specific vehicle class - remove specific edge ids diff --git a/tools/route/geoTrip2POI.py b/tools/route/geoTrip2POI.py index 5d1fc55cca17..98cdca7143a1 100755 --- a/tools/route/geoTrip2POI.py +++ b/tools/route/geoTrip2POI.py @@ -16,21 +16,21 @@ # @date 2025-01-16 """ -Load a file with trips define with fromLonLat / toLonLat and convert it to a poi file with POIs scaled to the relative amound of -departes/arrivals +Load a file with trips define with fromLonLat / toLonLat and convert it to a poi file +with POIs scaled to the relative amount of departs / arrivals """ from __future__ import absolute_import import sys import os +import random import colorsys from collections import defaultdict sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) -import sumolib +import sumolib # noqa from sumolib.xml import parse # noqa def parse_args(args): - USAGE = "Usage: " + sys.argv[0] + " [options]" op = sumolib.options.ArgumentParser(description="convert geoTrips to POIs") op.add_argument("routeFiles", nargs="+", category="input", type=op.file, help="trip files to analyze") @@ -53,8 +53,8 @@ def parse_args(args): def main(args): options = parse_args(args) - departLocs = defaultdict(lambda : 0) - arrivalLocs = defaultdict(lambda : 0) + departLocs = defaultdict(lambda: 0) + arrivalLocs = defaultdict(lambda: 0) for routefile in options.routeFiles: for trip in parse(routefile, 'trip'): @@ -62,16 +62,16 @@ def main(args): arrivalLocs[trip.toLonLat] += 1 maxCount = max( - max(departLocs.values()), - max(arrivalLocs.values())) + max(departLocs.values()), + max(arrivalLocs.values())) with open(options.outfile, 'w') as outf: - sumolib.writeXMLHeader(outf, "$Id$", root="additional", options=options) # noqa + sumolib.writeXMLHeader(outf, root="additional", options=options) for comment, counts, rgb in ( ('departures', departLocs, (1, 0, 0)), ('arrivals', arrivalLocs, (0, 0, 1))): - outf.write('\n' % comment); + outf.write('\n' % comment) hue, sat, val = colorsys.rgb_to_hsv(*rgb) for i, (lonLat, count) in enumerate(counts.items()): frac = 0.2 + (count / maxCount) * 0.8 diff --git a/tools/sumolib/statistics.py b/tools/sumolib/statistics.py index 65c99e1fc28e..6615f6e4c2a8 100644 --- a/tools/sumolib/statistics.py +++ b/tools/sumolib/statistics.py @@ -263,7 +263,7 @@ def toXML(self, precision=2, tag="statistic", indent=4, label=None, fmt=identity description = ' description="%s"' % label if label != '' else '' result = ' ' * indent + '<%s%s' % (tag, description) - for k,v in extraAttributes.items(): + for k, v in extraAttributes.items(): result += ' %s="%s"' % (k, v) if self.count() > 0: result += ' count="%i"' % self.count() From 0d747dfcd071fc0393bd16c72381f247404cee9c Mon Sep 17 00:00:00 2001 From: Mirko Barthauer Date: Fri, 17 Jan 2025 12:06:14 +0000 Subject: [PATCH 018/116] Translated using Weblate (Italian) Currently translated at 64.0% (1669 of 2606 strings) Translation: Eclipse SUMO/Applications Translate-URL: https://hosted.weblate.org/projects/eclipse-sumo/applications/it/ --- data/po/it_sumo.po | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/data/po/it_sumo.po b/data/po/it_sumo.po index ce81f51cfca2..ed87da9b99e6 100644 --- a/data/po/it_sumo.po +++ b/data/po/it_sumo.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: sumo\n" "Report-Msgid-Bugs-To: sumo-dev@eclipse.org\n" "POT-Creation-Date: 2025-01-06 11:22+0100\n" -"PO-Revision-Date: 2025-01-16 13:38+0000\n" +"PO-Revision-Date: 2025-01-17 12:25+0000\n" "Last-Translator: Mirko Barthauer \n" "Language-Team: Italian \n" @@ -2867,25 +2867,29 @@ msgstr "" #: src/microsim/MSFrame.cpp:931 msgid "The begin time should not be negative." -msgstr "" +msgstr "L'ora di inizio non deve essere negativa." #: src/microsim/MSFrame.cpp:941 msgid "The end time should be after the begin time." -msgstr "" +msgstr "L'ora terminale deve essere posteriore all'ora di inizio." #: src/microsim/MSFrame.cpp:946 msgid "the minimum step-length is 0.001." -msgstr "" +msgstr "il valore minimo del passo di simulazione è di 0.001." #: src/microsim/MSFrame.cpp:961 msgid "The save-state time=% will not be used before simulation end at %." msgstr "" +"L'ora % per salvare lo stato di simulazione non avverrà perché la " +"simulazione finisce a %." #: src/microsim/MSFrame.cpp:973 msgid "" "option movereminder-output.vehicles requires option movereminder-output to " "be set" msgstr "" +"l'opzione movereminder-output .vehicles richiede di impostare anche " +"l'opzione movereminder-output" #: src/microsim/MSFrame.cpp:978 msgid "" @@ -2906,6 +2910,8 @@ msgstr "" #: src/microsim/MSFrame.cpp:985 msgid "Sublane dynamics are not supported by mesoscopic simulation." msgstr "" +"La dinamica delle sottocorsie non è disponibile nella simulazione " +"mesoscopica." #: src/microsim/MSFrame.cpp:989 msgid "" @@ -2934,6 +2940,8 @@ msgid "" "Invalid value '%' for option 'default.emergencydecel'. Must be a FLOAT or " "'default' or 'decel'." msgstr "" +"Valore invalido '%' dell'opzione 'default.emergencydecel'. Deve essere un " +"FLOAT oppure 'default' o 'decel'." #: src/microsim/MSFrame.cpp:1043 msgid "" @@ -2951,17 +2959,20 @@ msgstr "" #: src/microsim/MSFrame.cpp:1069 msgid "You need at least one thread." -msgstr "" +msgstr "C'è bisogno di almeno un thread." #: src/microsim/MSFrame.cpp:1073 msgid "" "Number of threads exceeds number of thread-rngs. Simulation runs with the " "same seed may produce different results." msgstr "" +"Il numero di thread eccede il numero di generatori di numeri casuali. " +"Simulazioni inizializzate con lo stesso seme casuale possono generare " +"risultati differenti." #: src/microsim/MSFrame.cpp:1076 msgid "game.mode must be one of ['tls', 'drt']" -msgstr "" +msgstr "game.mode deve essere uno tra ['tls', 'drt']" #: src/microsim/MSFrame.cpp:1083 msgid "" @@ -2984,12 +2995,12 @@ msgstr "" #: src/microsim/MSInsertionControl.cpp:284 src/router/RONet.cpp:481 #, c-format msgid "Another vehicle with the id '%' exists." -msgstr "" +msgstr "Esiste già un veicolo con il codice identificativo '%'." #: src/microsim/MSInternalJunction.cpp:55 #, c-format msgid "Internal junction % has no incoming lanes" -msgstr "" +msgstr "L'incrocio interno % non tiene corsie entranti" #: src/microsim/MSLane.cpp:334 msgid "Unequal lengths of neigh lane '%' and lane '%' (% != %)." @@ -3029,15 +3040,15 @@ msgstr "" #: src/microsim/MSLane.cpp:2012 msgid "frontal collision" -msgstr "" +msgstr "collisione frontale" #: src/microsim/MSLane.cpp:2013 msgid "junction collision" -msgstr "" +msgstr "collisione sull'incrocio" #: src/microsim/MSLane.cpp:2013 msgid "collision" -msgstr "" +msgstr "collisione" #: src/microsim/MSLane.cpp:2019 msgid "Vehicle '%'; % with vehicle '%" From 48ef578de38f9a12642349473dd43f6e749b68fa Mon Sep 17 00:00:00 2001 From: Mirko Barthauer Date: Mon, 20 Jan 2025 07:47:42 +0000 Subject: [PATCH 019/116] Translated using Weblate (Italian) Currently translated at 64.6% (1684 of 2606 strings) Translation: Eclipse SUMO/Applications Translate-URL: https://hosted.weblate.org/projects/eclipse-sumo/applications/it/ --- data/po/it_sumo.po | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/data/po/it_sumo.po b/data/po/it_sumo.po index ed87da9b99e6..436e90a57fa8 100644 --- a/data/po/it_sumo.po +++ b/data/po/it_sumo.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: sumo\n" "Report-Msgid-Bugs-To: sumo-dev@eclipse.org\n" "POT-Creation-Date: 2025-01-06 11:22+0100\n" -"PO-Revision-Date: 2025-01-17 12:25+0000\n" +"PO-Revision-Date: 2025-01-20 12:30+0000\n" "Last-Translator: Mirko Barthauer \n" "Language-Team: Italian \n" @@ -2955,7 +2955,7 @@ msgstr "C'è bisogno di un valore di ritardo non negativo." #: src/microsim/MSFrame.cpp:1064 msgid "Parallel simulation is only possible when compiled with Fox." -msgstr "" +msgstr "La simulazione parallela é possibile unicamente se compilato con Fox." #: src/microsim/MSFrame.cpp:1069 msgid "You need at least one thread." @@ -2979,12 +2979,16 @@ msgid "" "Invalid transfer option '%'. Must be one of 'parkingAreas', 'ptStops' or " "'allJunctions'." msgstr "" +"Opzione di trasbordo invalida '%'. Deve essere una di 'parkingAreas', " +"'ptStops' o 'allJunctions'." #: src/microsim/MSFrame.cpp:1093 msgid "" "Invalid JuPedSim model '%'. Must be one of 'CollisionFreeSpeed', " "'CollisionFreeSpeedV2', 'GeneralizedCentrifugalForce' or 'SocialForce'." msgstr "" +"Modello JuPedSim invalido '%'. Deve essere uno di 'CollisionFreeSpeed', " +"'CollisionFreeSpeedV2', 'GeneralizedCentrifugalForce' o 'SocialForce'." #: src/microsim/MSFrame.cpp:1154 msgid "" @@ -3004,25 +3008,29 @@ msgstr "L'incrocio interno % non tiene corsie entranti" #: src/microsim/MSLane.cpp:334 msgid "Unequal lengths of neigh lane '%' and lane '%' (% != %)." -msgstr "" +msgstr "Lunghezze differenti tra la corsia vicina '%' e la corsia '%' (% != %)." #: src/microsim/MSLane.cpp:343 msgid "Unequal lengths of bidi lane '%' and lane '%' (% != %)." msgstr "" +"Lunghezze differenti tra la corsia bidirezionale '%' e la corsia '%' (% != " +"%)." #: src/microsim/MSLane.cpp:810 #, c-format msgid "Vehicle '%' is inserted in emergency situation." -msgstr "" +msgstr "Il veicolo '%' viene inserito in una situazione di emergenza." #: src/microsim/MSLane.cpp:816 msgid "Vehicle '%' will not be able to depart using the given velocity (%)!" -msgstr "" +msgstr "Il veicolo '%' non sarà capace di partire con la velocità indicata (%)!" #: src/microsim/MSLane.cpp:833 msgid "" "Invalid departPos % given for vehicle '%'. Inserting at lane end instead." msgstr "" +"La posizione di partenza (departPos) invalida % è stata data per veicolo " +"'%'. Pertanto il veicolo verrà inserito alla fine della corsia." #: src/microsim/MSLane.cpp:1094 msgid "" @@ -3070,11 +3078,15 @@ msgstr "" msgid "" "Removing % participant: vehicle '%', keeping remote-controlled vehicle '%" msgstr "" +"Il veicolo participante % '%' viene rimosso e mantenuto il veicolo " +"controllato esternamente '%" #: src/microsim/MSLane.cpp:2099 msgid "" "Keeping remote-controlled % participant: vehicle '%', removing vehicle '%" msgstr "" +"Il veicolo controllato esternamente % '%' viene rimosso e mantenuto il " +"veicolo participante '%" #: src/microsim/MSLane.cpp:2110 msgid ", latGap=" @@ -3110,6 +3122,8 @@ msgstr "" #: src/microsim/MSLane.cpp:2252 msgid "Removing vehicle '%' after breaking down, lane='%', time=%." msgstr "" +"Il veicolo '%' viene rimosso dopo essere rimasto fermo sulla corsia '%' alle " +"%." #: src/microsim/MSLane.cpp:2263 msgid "Teleporting vehicle '%'; beyond end of lane, target lane='%', time=%." @@ -3174,11 +3188,11 @@ msgstr "Simulazione finita alle ore %." #: src/microsim/MSNet.cpp:680 msgid "Reason: " -msgstr "" +msgstr "Motivo: " #: src/microsim/MSNet.cpp:940 msgid "The final simulation step has been reached." -msgstr "" +msgstr "Il passo finale della simulazione è stato raggiunto." #: src/microsim/MSNet.cpp:942 msgid "All vehicles have left the simulation." @@ -4132,6 +4146,7 @@ msgstr "" #: src/microsim/devices/MSDevice_Routing.cpp:84 msgid "The number of parallel execution threads used for rerouting" msgstr "" +"Il numero di thread di esecuzione paralleli da usare per l'instradamento" #: src/microsim/devices/MSDevice_Routing.cpp:87 msgid "Let rerouting happen at the same time for all vehicles" @@ -4170,7 +4185,7 @@ msgstr "" #: src/microsim/devices/MSDevice_Routing.cpp:122 src/router/ROFrame.cpp:252 msgid "Parallel routing is only possible when compiled with Fox." -msgstr "" +msgstr "L'instradamento parallelo é possibile unicamente se compilato con Fox." #: src/microsim/devices/MSDevice_Routing.cpp:127 msgid "Adapting number of routing threads to number of simulation threads." From c874dc96f2648b365fb9786410c9d706f18980ef Mon Sep 17 00:00:00 2001 From: Robert Hilbrich Date: Mon, 20 Jan 2025 14:38:29 +0100 Subject: [PATCH 020/116] trying to add jupedsim to native macOS installer, refs #15213 --- tools/build_config/buildMacOSInstaller.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/build_config/buildMacOSInstaller.py b/tools/build_config/buildMacOSInstaller.py index dcfdd8654004..8ff5b2be4956 100755 --- a/tools/build_config/buildMacOSInstaller.py +++ b/tools/build_config/buildMacOSInstaller.py @@ -174,6 +174,12 @@ def create_framework(name, longname, pkg_id, version, sumo_build_directory): ] subprocess.run(cmake_install_command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + # Copy the JuPedSim Lib + jupedsimlib_src = "/Users/genie.sumo/jenkins/workspace/macOS Installer/jupedsim-install/lib/libjupedsim.dylib" + jupedsimlib_dst = os.path.join(version_dir, name, "lib") + print(f" - Copying jupedsim lib {jupedsimlib_src} --> {jupedsimlib_dst}") + shutil.copy(jupedsimlib_src, jupedsimlib_dst) + # We need to add a symlink to the binary folder to have the same folder structure os.symlink("../../bin", os.path.join(version_dir, name, "share", "sumo", "bin")) From 462419d1752b96846907a81e102bb7218fb1644e Mon Sep 17 00:00:00 2001 From: Robert Hilbrich Date: Mon, 20 Jan 2025 15:04:33 +0100 Subject: [PATCH 021/116] reverting prev. commit, refs #15213 --- tools/build_config/buildMacOSInstaller.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/build_config/buildMacOSInstaller.py b/tools/build_config/buildMacOSInstaller.py index 8ff5b2be4956..dcfdd8654004 100755 --- a/tools/build_config/buildMacOSInstaller.py +++ b/tools/build_config/buildMacOSInstaller.py @@ -174,12 +174,6 @@ def create_framework(name, longname, pkg_id, version, sumo_build_directory): ] subprocess.run(cmake_install_command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - # Copy the JuPedSim Lib - jupedsimlib_src = "/Users/genie.sumo/jenkins/workspace/macOS Installer/jupedsim-install/lib/libjupedsim.dylib" - jupedsimlib_dst = os.path.join(version_dir, name, "lib") - print(f" - Copying jupedsim lib {jupedsimlib_src} --> {jupedsimlib_dst}") - shutil.copy(jupedsimlib_src, jupedsimlib_dst) - # We need to add a symlink to the binary folder to have the same folder structure os.symlink("../../bin", os.path.join(version_dir, name, "share", "sumo", "bin")) From 8151309d1713f46e568d6e7c5622ef61d1cba5be Mon Sep 17 00:00:00 2001 From: Robert Hilbrich Date: Mon, 20 Jan 2025 15:11:45 +0100 Subject: [PATCH 022/116] testing with DYLD_LIB_PATH, refs #15213 --- tools/build_config/buildMacOSInstaller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_config/buildMacOSInstaller.py b/tools/build_config/buildMacOSInstaller.py index dcfdd8654004..fb3517f99af1 100755 --- a/tools/build_config/buildMacOSInstaller.py +++ b/tools/build_config/buildMacOSInstaller.py @@ -191,6 +191,7 @@ def create_framework(name, longname, pkg_id, version, sumo_build_directory): shutil.move(os.path.join(lib_dir, file_name), os.path.join(bin_dir, file_name)) # Start the delocation of the libraries and binaries + print(f"DYLD_LIBRARY_PATH: {os.environ.get("DYLD_LIBRARY_PATH", "Not set")}") delocate_path("./bin", lib_filt_func=None, lib_path="./lib", sanitize_rpaths=True) # - and we need to move them back to the lib folder From 1219e05819714c1c34356ec87374e7106ca0c86e Mon Sep 17 00:00:00 2001 From: Robert Hilbrich Date: Mon, 20 Jan 2025 15:31:13 +0100 Subject: [PATCH 023/116] reverting, refs #15213 --- tools/build_config/buildMacOSInstaller.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/build_config/buildMacOSInstaller.py b/tools/build_config/buildMacOSInstaller.py index fb3517f99af1..dcfdd8654004 100755 --- a/tools/build_config/buildMacOSInstaller.py +++ b/tools/build_config/buildMacOSInstaller.py @@ -191,7 +191,6 @@ def create_framework(name, longname, pkg_id, version, sumo_build_directory): shutil.move(os.path.join(lib_dir, file_name), os.path.join(bin_dir, file_name)) # Start the delocation of the libraries and binaries - print(f"DYLD_LIBRARY_PATH: {os.environ.get("DYLD_LIBRARY_PATH", "Not set")}") delocate_path("./bin", lib_filt_func=None, lib_path="./lib", sanitize_rpaths=True) # - and we need to move them back to the lib folder From 577bf75a1f9723cc73ff9bcc2a3e6921076d3d6d Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Mon, 20 Jan 2025 09:58:39 +0100 Subject: [PATCH 024/116] Added function openPolygon(). Refs #15844 --- src/netedit/elements/additional/GNEPoly.cpp | 6 +++--- src/utils/geom/PositionVector.cpp | 8 ++++++++ src/utils/geom/PositionVector.h | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/netedit/elements/additional/GNEPoly.cpp b/src/netedit/elements/additional/GNEPoly.cpp index 3b34695d363a..6d7c1f1028d6 100644 --- a/src/netedit/elements/additional/GNEPoly.cpp +++ b/src/netedit/elements/additional/GNEPoly.cpp @@ -663,7 +663,7 @@ GNEPoly::isValid(SumoXMLAttr key, const std::string& value) { case SUMO_ATTR_NAME: return SUMOXMLDefinitions::isValidAttribute(value); case GNE_ATTR_CLOSE_SHAPE: - if (canParse(value)) { + if (canParse(value) && (myShape.size() > 0)) { bool closePolygon = parse(value); if (closePolygon && (myShape.begin() == myShape.end())) { // Polygon already closed, then invalid value @@ -821,8 +821,8 @@ GNEPoly::setAttribute(SumoXMLAttr key, const std::string& value) { myShape.closePolygon(); myGeoShape.closePolygon(); } else { - myShape.pop_back(); - myGeoShape.pop_back(); + myShape.openPolygon(); + myGeoShape.openPolygon(); } // disable simplified shape flag mySimplifiedShape = false; diff --git a/src/utils/geom/PositionVector.cpp b/src/utils/geom/PositionVector.cpp index e56ee77339b8..ce4e59030024 100644 --- a/src/utils/geom/PositionVector.cpp +++ b/src/utils/geom/PositionVector.cpp @@ -1354,6 +1354,14 @@ PositionVector::angleAt2D(int pos) const { } +void +PositionVector::openPolygon() { + if ((size() > 1) && (front() == back())) { + pop_back(); + } +} + + void PositionVector::closePolygon() { if ((size() != 0) && ((*this)[0] != back())) { diff --git a/src/utils/geom/PositionVector.h b/src/utils/geom/PositionVector.h index 9b74fdd78532..bcfab8cd996a 100644 --- a/src/utils/geom/PositionVector.h +++ b/src/utils/geom/PositionVector.h @@ -150,6 +150,9 @@ class PositionVector : public AbstractPoly, private std::vector { /// @brief Returns the position of the intersection Position intersectionPosition2D(const PositionVector& v1) const; + /// @brief open polygon + void openPolygon(); + /// @brief ensures that the last position equals the first void closePolygon(); From e3de5f0510b04a68f887e46b1a59ca4f122aaa0c Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Mon, 20 Jan 2025 10:00:57 +0100 Subject: [PATCH 025/116] Updated Triangle. Refs #15844 --- src/utils/geom/Triangle.cpp | 89 +++++++++---------------------------- src/utils/geom/Triangle.h | 19 +++----- 2 files changed, 28 insertions(+), 80 deletions(-) diff --git a/src/utils/geom/Triangle.cpp b/src/utils/geom/Triangle.cpp index 8d7b8f3455ed..d1ab49345c04 100644 --- a/src/utils/geom/Triangle.cpp +++ b/src/utils/geom/Triangle.cpp @@ -33,7 +33,11 @@ Triangle::Triangle(const Position& positionA, const Position& positionB, const P myA(positionA), myB(positionB), myC(positionC) { + // calculate area and boundary myArea = calculateTriangleArea2D(myA, myB, myC); + myBoundary.add(positionA); + myBoundary.add(positionB); + myBoundary.add(positionC); } @@ -42,84 +46,35 @@ Triangle::~Triangle() {} bool Triangle::isAround(const Position& pos) const { - if (myArea == -1) { - return false; - } else { - const double areaPAB = calculateTriangleArea2D(pos, myA, myB); - const double areaPBC = calculateTriangleArea2D(pos, myB, myC); - const double areaPCA = calculateTriangleArea2D(pos, myC, myA); - // Check if the sum of the areas matches the total area of the triangle - return std::abs(myArea - (areaPAB + areaPBC + areaPCA)) < 1e-9; - } + const double areaPAB = calculateTriangleArea2D(pos, myA, myB); + const double areaPBC = calculateTriangleArea2D(pos, myB, myC); + const double areaPCA = calculateTriangleArea2D(pos, myC, myA); + // Check if the sum of the areas matches the total area of ​​the triangle + return std::abs(myArea - (areaPAB + areaPBC + areaPCA)) < 1e-9; } std::vector -Triangle::triangulate(const PositionVector& shape) { +Triangle::triangulate(PositionVector shape) { std::vector triangles; - // check that shape has at least three positions - if (shape.size() < 3) { - return triangles; - } else { - PositionVector remainingPoints = shape; - // greedy algorithm - while (remainingPoints.size() > 3) { - const int numRemainingPoints = (int)remainingPoints.size(); - for (int i = 0; i < numRemainingPoints; i++) { - int prevIndex = (i - 1 + numRemainingPoints) % numRemainingPoints; - int nextIndex = (i + 1) % numRemainingPoints; - // get previous, current and next point - const Position& previousPoint = remainingPoints[prevIndex]; - const Position& currentPoint = remainingPoints[i]; - const Position& nextPoint = remainingPoints[nextIndex]; - // check that the vertex is an "ear" - if (isLeft(currentPoint, previousPoint, nextPoint)) { - bool isEar = true; - for (int j = 0; j < numRemainingPoints; j++) { - if (j != i && j != prevIndex && j != nextIndex) { - if (isInsideTriangle2D(remainingPoints[j], previousPoint, currentPoint, nextPoint)) { - isEar = false; - break; - } - } - } - if (isEar) { - triangles.push_back(Triangle(previousPoint, currentPoint, nextPoint)); - remainingPoints.erase(remainingPoints.begin() + i); - break; - } - } - } - } - // insert the last triangle - if (remainingPoints.size() == 3) { - triangles.push_back(Triangle(remainingPoints[0], remainingPoints[1], remainingPoints[2])); - } - return triangles; + // first open polygon + shape.openPolygon(); + // greedy algorithm + while (shape.size() > 3) { + triangles.push_back(Triangle(shape[0], shape[1], shape[2])); + shape.erase(shape.begin() + 1); } -} - - -bool -Triangle::isLeft(const Position& p, const Position& a, const Position& b) { - return ((b.x() - a.x()) * (p.y() - a.y())) > ((b.y() - a.y()) * (p.x() - a.x())); + // add last triangle + if (shape.size() > 2) { + triangles.push_back(Triangle(shape[0], shape[1], shape[0])); + } + return triangles; } double -Triangle::calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) { +Triangle::calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) const { return std::abs((a.x() * (b.y() - c.y()) + b.x() * (c.y() - a.y()) + c.x() * (a.y() - b.y())) / 2.0); } - -bool -Triangle::isInsideTriangle2D(const Position& pos, const Position& a, const Position& b, const Position& c) { - const double areaABC = calculateTriangleArea2D(a, b, c); - const double areaPAB = calculateTriangleArea2D(pos, a, b); - const double areaPBC = calculateTriangleArea2D(pos, b, c); - const double areaPCA = calculateTriangleArea2D(pos, c, a); - // Check if the sum of the areas matches the total area of ​​the triangle - return std::abs(areaABC - (areaPAB + areaPBC + areaPCA)) < 1e-9; -} - /****************************************************************************/ diff --git a/src/utils/geom/Triangle.h b/src/utils/geom/Triangle.h index 5133175bd714..522548dc91e4 100644 --- a/src/utils/geom/Triangle.h +++ b/src/utils/geom/Triangle.h @@ -23,6 +23,7 @@ #include #include "PositionVector.h" +#include "Boundary.h" // =========================================================================== // class definitions @@ -47,22 +48,11 @@ class Triangle { bool isAround(const Position &pos) const; // @brief triangulate using Ear Clipping algorithm - static std::vector triangulate(const PositionVector &shape); + static std::vector triangulate(PositionVector shape); private: - /// @name function used in triangulate function - /// @{ - - /// @brief check if point p is to the left of line ab - static bool isLeft(const Position &p, const Position &a, const Position &b); - /// @brief calculate triangle area (2D) - static double calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) ; - - /// @brief check if the given point is whitin the triangle formed by a-b-c - static bool isInsideTriangle2D(const Position &pos, const Position &a, const Position &b, const Position &c); - - /// @} + double calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) const; /// @brief first triangle position Position myA = Position::INVALID; @@ -75,4 +65,7 @@ class Triangle { /// @brief triangle Area double myArea = -1; + + /// @brief triangle boundary + Boundary myBoundary; }; From b9524b3bb72691680b44919eaf7290cdc9766a9d Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Mon, 20 Jan 2025 12:27:01 +0100 Subject: [PATCH 026/116] Improved calculation of isAroundPosition(). Refs #15844 --- src/utils/geom/Triangle.cpp | 107 +++++++++++++++++++++++++++++++----- src/utils/geom/Triangle.h | 20 ++++++- 2 files changed, 113 insertions(+), 14 deletions(-) diff --git a/src/utils/geom/Triangle.cpp b/src/utils/geom/Triangle.cpp index d1ab49345c04..77f3065ba671 100644 --- a/src/utils/geom/Triangle.cpp +++ b/src/utils/geom/Triangle.cpp @@ -45,12 +45,61 @@ Triangle::~Triangle() {} bool -Triangle::isAround(const Position& pos) const { - const double areaPAB = calculateTriangleArea2D(pos, myA, myB); - const double areaPBC = calculateTriangleArea2D(pos, myB, myC); - const double areaPCA = calculateTriangleArea2D(pos, myC, myA); - // Check if the sum of the areas matches the total area of ​​the triangle - return std::abs(myArea - (areaPAB + areaPBC + areaPCA)) < 1e-9; +Triangle::isAroundPosition(const Position &pos) const { + // Calculate cross products for each edge of the triangle + const double crossAB = crossProduct(myA, myB, pos); + const double crossBC = crossProduct(myB, myC, pos); + const double crossCA = crossProduct(myC, myA, pos); + // Check if all cross products have the same sign + return (crossAB >= 0 && crossBC >= 0 && crossCA >= 0) || + (crossAB <= 0 && crossBC <= 0 && crossCA <= 0); +} + + +bool +Triangle::isAroundShape(const PositionVector &shape) const { + if (isBoundaryAround(shape.getBoxBoundary())) { + return true; + } else { + for (const auto &pos : shape) { + if (isAroundPosition(pos)) { + return true; + } + } + return false; + } +} + +bool +Triangle::isBoundaryAround(const Boundary &boundary) const { + if (isAroundPosition(Position(boundary.xmin(), boundary.ymin())) && + isAroundPosition(Position(boundary.xmin(), boundary.ymax())) && + isAroundPosition(Position(boundary.xmax(), boundary.ymin())) && + isAroundPosition(Position(boundary.xmax(), boundary.ymax()))) { + return true; + } else { + return false; + } +} + + +bool +Triangle::isCircunferenceAround(const Position& center, const double radius) const { + if (lineIntersectCircle(myA, myB, center, radius)) { + return true; + } else if (lineIntersectCircle(myA, myB, center, radius)) { + return true; + } else if (lineIntersectCircle(myA, myB, center, radius)) { + return true; + } else { + return isAroundPosition(center); + } +} + + +const Boundary& +Triangle::getBoundary() const { + return myBoundary; } @@ -59,14 +108,15 @@ Triangle::triangulate(PositionVector shape) { std::vector triangles; // first open polygon shape.openPolygon(); - // greedy algorithm - while (shape.size() > 3) { + // we need at leas three vertex + if (shape.size() >= 3) { + // greedy algorithm + while (shape.size() > 3) { + triangles.push_back(Triangle(shape[0], shape[1], shape[2])); + shape.erase(shape.begin() + 1); + } + // add last triangle triangles.push_back(Triangle(shape[0], shape[1], shape[2])); - shape.erase(shape.begin() + 1); - } - // add last triangle - if (shape.size() > 2) { - triangles.push_back(Triangle(shape[0], shape[1], shape[0])); } return triangles; } @@ -77,4 +127,35 @@ Triangle::calculateTriangleArea2D(const Position& a, const Position& b, const Po return std::abs((a.x() * (b.y() - c.y()) + b.x() * (c.y() - a.y()) + c.x() * (a.y() - b.y())) / 2.0); } + +double +Triangle::crossProduct(const Position& A, const Position& B, const Position& C) const { + return (B.x() - A.x()) * (C.y() - A.y()) - (B.y() - A.y()) * (C.x() - A.x()); +} + + +bool +Triangle::lineIntersectCircle(const Position& posA, const Position& posB, const Position& center, const double radius) const { + // Calculate coefficients of the quadratic equation + const double dx = posB.x() - posA.x(); + const double dy = posB.y() - posA.y(); + const double a = dx * dx + dy * dy; + const double b = 2 * (dx * (posA.x() - center.x()) + dy * (posA.y() - center.y())); + const double c = (posA.x() - center.x()) * (posA.x() - center.x()) + (posA.y() - center.y()) * (posA.y() - center.y()) - radius * radius; + // Calculate the discriminant + const double discriminant = (b * b - 4 * a * c); + // Check the discriminant to determine the intersection + if (discriminant >= 0) { + // Calculate the two possible values of t + const double sqrtDiscriminant = sqrt(discriminant); + const double t1 = (-b + sqrtDiscriminant) / (2 * a); + const double t2 = (-b - sqrtDiscriminant) / (2 * a); + // if at least t1 or t2 is between [0,1], then intersect + return (t1 >= 0 && t1 <= 1) || (t2 >= 0 && t2 <= 1); + } + else { + return false; + } +} + /****************************************************************************/ diff --git a/src/utils/geom/Triangle.h b/src/utils/geom/Triangle.h index 522548dc91e4..59544c76b908 100644 --- a/src/utils/geom/Triangle.h +++ b/src/utils/geom/Triangle.h @@ -44,8 +44,20 @@ class Triangle { /// @brief destructor ~Triangle(); + /// @brief get triangle boundary + const Boundary &getBoundary() const; + /// @brief check if the given position is within this triangle - bool isAround(const Position &pos) const; + bool isAroundPosition(const Position &pos) const; + + /// @brief check if the given shape is within this triangle or intersect in a certain point + bool isAroundShape(const PositionVector &shape) const; + + /// @brief check if the given boundary is within this triangle + bool isBoundaryAround(const Boundary &boundary) const; + + /// @brief check if the given circunference is within this triangle + bool isCircunferenceAround(const Position& center, const double radius) const; // @brief triangulate using Ear Clipping algorithm static std::vector triangulate(PositionVector shape); @@ -54,6 +66,12 @@ class Triangle { /// @brief calculate triangle area (2D) double calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) const; + /// @brief calculate cross product of the given points + double crossProduct(const Position& A, const Position& B, const Position& C) const; + + /// @brief function to check if line between posA and posB intersect circle + bool lineIntersectCircle(const Position& posA, const Position& posB, const Position& center, const double radius) const; + /// @brief first triangle position Position myA = Position::INVALID; From 7f6c82b7317bf74741af05d63357c3bcc4263ae5 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Mon, 20 Jan 2025 12:27:44 +0100 Subject: [PATCH 027/116] Now netedit uses triangulation for locating elements within a polygon. Refs #15844 --- src/netedit/GNENetHelper.cpp | 18 +++++------ src/netedit/GNENetHelper.h | 5 ++-- src/netedit/GNEViewNet.cpp | 35 ++++++++++++---------- src/netedit/frames/network/GNETAZFrame.cpp | 18 ++++++----- 4 files changed, 42 insertions(+), 34 deletions(-) diff --git a/src/netedit/GNENetHelper.cpp b/src/netedit/GNENetHelper.cpp index 676f45a227c0..bfd1df3e1907 100644 --- a/src/netedit/GNENetHelper.cpp +++ b/src/netedit/GNENetHelper.cpp @@ -179,40 +179,40 @@ GNENetHelper::AttributeCarriers::remapJunctionAndEdgeIds() { bool -GNENetHelper::AttributeCarriers::isNetworkElementAroundShape(GNEAttributeCarrier* AC, const PositionVector& shape) const { +GNENetHelper::AttributeCarriers::isNetworkElementAroundTriangle(GNEAttributeCarrier* AC, const Triangle& triangle) const { // check what type of AC if (AC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) { // Junction const GNEJunction* junction = myJunctions.at(AC->getID()); if (junction->getNBNode()->getShape().size() == 0) { - return shape.around(junction->getNBNode()->getCenter()); + return triangle.isAroundPosition(junction->getNBNode()->getCenter()); } else { - return (shape.overlapsWith(junction->getNBNode()->getShape())); + return (triangle.isAroundShape(junction->getNBNode()->getShape())); } } else if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) { // Edge for (const auto& lane : myEdges.at(AC->getID())->getLanes()) { - if (shape.overlapsWith(lane->getLaneShape())) { + if (triangle.isAroundShape(lane->getLaneShape())) { return true; } } return false; } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) { // Lane - return shape.overlapsWith(retrieveLane(AC->getID())->getLaneShape()); + return triangle.isAroundShape(retrieveLane(AC->getID())->getLaneShape()); } else if (AC->getTagProperty().getTag() == SUMO_TAG_CONNECTION) { // connection - return shape.overlapsWith(myConnections.at(AC->getGUIGlObject())->getConnectionShape()); + return triangle.isAroundShape(myConnections.at(AC->getGUIGlObject())->getConnectionShape()); } else if (AC->getTagProperty().getTag() == SUMO_TAG_CROSSING) { // crossing - return shape.overlapsWith(myCrossings.at(AC->getGUIGlObject())->getCrossingShape()); + return triangle.isAroundShape(myCrossings.at(AC->getGUIGlObject())->getCrossingShape()); } else if (AC->getTagProperty().isAdditionalElement()) { // Additional (including shapes and TAZs const GNEAdditional* additional = retrieveAdditional(AC->getGUIGlObject()); if (additional->getAdditionalGeometry().getShape().size() <= 1) { - return shape.around(additional->getPositionInView()); + return triangle.isAroundPosition(additional->getPositionInView()); } else { - return shape.overlapsWith(additional->getAdditionalGeometry().getShape()); + return triangle.isAroundShape(additional->getAdditionalGeometry().getShape()); } } else { return false; diff --git a/src/netedit/GNENetHelper.h b/src/netedit/GNENetHelper.h index f5cfd7a441a7..42da9aa22d30 100644 --- a/src/netedit/GNENetHelper.h +++ b/src/netedit/GNENetHelper.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -107,8 +108,8 @@ struct GNENetHelper { /// @brief remap junction and edge IDs void remapJunctionAndEdgeIds(); - /// @brief check if shape of given AC (network element) is around the given shape - bool isNetworkElementAroundShape(GNEAttributeCarrier* AC, const PositionVector& shape) const; + /// @brief check if shape of given AC (network element) is around the given triangle + bool isNetworkElementAroundTriangle(GNEAttributeCarrier* AC, const Triangle& triangle) const; /// @brief functions related with number of elements sorted by categories /// @{ diff --git a/src/netedit/GNEViewNet.cpp b/src/netedit/GNEViewNet.cpp index 4627eb1cd508..f61ce8afef6f 100644 --- a/src/netedit/GNEViewNet.cpp +++ b/src/netedit/GNEViewNet.cpp @@ -2733,30 +2733,33 @@ GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) { GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition(); // check polygon if (polygonUnderMouse) { - // get ACs in boundary - updateObjectsInBoundary(polygonUnderMouse->getShape().getBoxBoundary()); + // triangulate shape + const auto triangulation = Triangle::triangulate(polygonUnderMouse->getShape()); // declare filtered ACs - std::vector filteredACs; - // iterate over obtained GUIGlIDs - for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) { - if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) { - if (checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) { - filteredACs.push_back(AC); - } - } else if (AC->getTagProperty().getTag() == SUMO_TAG_LANE) { - if (!checkSelectEdges() && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) { - filteredACs.push_back(AC); + std::vector ACsUnderPolygon; + // iterate over every triangle + for (const auto &triangle : triangulation) { + // get ACs in boundary + updateObjectsInBoundary(triangle.getBoundary()); + // iterate over obtained GUIGlIDs + for (const auto& AC : myViewObjectsSelector.getAttributeCarriers()) { + if (myNet->getAttributeCarriers()->isNetworkElementAroundTriangle(AC, triangle)) { + if ((AC->getTagProperty().getTag() == SUMO_TAG_EDGE) && checkSelectEdges()) { + ACsUnderPolygon.push_back(AC); + } else if ((AC->getTagProperty().getTag() == SUMO_TAG_LANE) && !checkSelectEdges()) { + ACsUnderPolygon.push_back(AC); + } else if (AC != polygonUnderMouse) { + ACsUnderPolygon.push_back(AC); + } } - } else if ((AC != polygonUnderMouse) && myNet->getAttributeCarriers()->isNetworkElementAroundShape(AC, polygonUnderMouse->getShape())) { - filteredACs.push_back(AC); } } // continue if there are ACs - if (filteredACs.size() > 0) { + if (ACsUnderPolygon.size() > 0) { // begin undo-list myNet->getViewNet()->getUndoList()->begin(GUIIcon::MODESELECT, TL("select within polygon boundary")); // iterate over shapes - for (const auto& AC : filteredACs) { + for (const auto& AC : ACsUnderPolygon) { AC->setAttribute(GNE_ATTR_SELECTED, "true", myUndoList); } // end undo-list diff --git a/src/netedit/frames/network/GNETAZFrame.cpp b/src/netedit/frames/network/GNETAZFrame.cpp index c0425130f566..dc289b0e3e85 100644 --- a/src/netedit/frames/network/GNETAZFrame.cpp +++ b/src/netedit/frames/network/GNETAZFrame.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include "GNETAZFrame.h" @@ -1629,14 +1630,17 @@ GNETAZFrame::shapeDrawed() { } // check if TAZ has to be created with edges if (myTAZParameters->isAddEdgesWithinEnabled()) { - // update objects in boundary - myViewNet->updateObjectsInBoundary(shape.getBoxBoundary()); - // get all edge IDs std::vector edgeIDs; - // get only edges with geometry around shape - for (const auto& edge : myViewNet->getViewObjectsSelector().getEdges()) { - if (myViewNet->getNet()->getAttributeCarriers()->isNetworkElementAroundShape(edge, shape)) { - edgeIDs.push_back(edge->getID()); + // triangulate shape + const auto triangulation = Triangle::triangulate(shape); + for (const auto &triangle : triangulation) { + // update objects in boundary + myViewNet->updateObjectsInBoundary(triangle.getBoundary()); + // get only edges with geometry around triangle + for (const auto& edge : myViewNet->getViewObjectsSelector().getEdges()) { + if (myViewNet->getNet()->getAttributeCarriers()->isNetworkElementAroundTriangle(edge, triangle)) { + edgeIDs.push_back(edge->getID()); + } } } myBaseTAZ->addStringListAttribute(SUMO_ATTR_EDGES, edgeIDs); From 60ab58457088963b6d9c24453a844106504c04d4 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Mon, 20 Jan 2025 13:25:43 +0100 Subject: [PATCH 028/116] Added function "triangulation for polygons. Refs #15844 --- src/netedit/GNEViewNet.cpp | 32 ++++++++++++++++++++- src/netedit/GNEViewNet.h | 3 ++ src/netedit/elements/additional/GNEPoly.cpp | 24 ++++++++++++++++ src/netedit/elements/additional/GNEPoly.h | 4 +++ src/utils/geom/Triangle.cpp | 6 ++++ src/utils/geom/Triangle.h | 3 ++ src/utils/gui/windows/GUIAppEnum.h | 2 ++ 7 files changed, 73 insertions(+), 1 deletion(-) diff --git a/src/netedit/GNEViewNet.cpp b/src/netedit/GNEViewNet.cpp index f61ce8afef6f..8e9bb0ebc30b 100644 --- a/src/netedit/GNEViewNet.cpp +++ b/src/netedit/GNEViewNet.cpp @@ -213,6 +213,7 @@ FXDEFMAP(GNEViewNet) GNEViewNetMap[] = { FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_CLOSE, GNEViewNet::onCmdClosePolygon), FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_OPEN, GNEViewNet::onCmdOpenPolygon), FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_SELECT, GNEViewNet::onCmdSelectPolygonElements), + FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_TRIANGULATE, GNEViewNet::onCmdTriangulatePolygon), FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_SET_FIRST_POINT, GNEViewNet::onCmdSetFirstGeometryPoint), FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_DELETE_GEOMETRY_POINT, GNEViewNet::onCmdDeleteGeometryPoint), // edit custom shapes @@ -2748,7 +2749,7 @@ GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) { ACsUnderPolygon.push_back(AC); } else if ((AC->getTagProperty().getTag() == SUMO_TAG_LANE) && !checkSelectEdges()) { ACsUnderPolygon.push_back(AC); - } else if (AC != polygonUnderMouse) { + } else if (!AC->getTagProperty().isSymbol() && (AC != polygonUnderMouse)) { ACsUnderPolygon.push_back(AC); } } @@ -2770,6 +2771,35 @@ GNEViewNet::onCmdSelectPolygonElements(FXObject*, FXSelector, void*) { } +long +GNEViewNet::onCmdTriangulatePolygon(FXObject*, FXSelector, void*) { +// get polygon under mouse + GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition(); + // check polygon + if (polygonUnderMouse) { + // declare additional handler + GNEAdditionalHandler additionalHandler(myNet, myViewParent->getGNEAppWindows()->isUndoRedoAllowed(), false); + // triangulate shape + const auto triangulation = Triangle::triangulate(polygonUnderMouse->getShape()); + // begin undo-list + myNet->getViewNet()->getUndoList()->begin(GUIIcon::POLY, TL("triangulate polygon")); + // create every individual triangle + for (const auto &triangle : triangulation) { + auto basePolygon = polygonUnderMouse->getSumoBaseObject(); + basePolygon->addStringAttribute(SUMO_ATTR_ID, myNet->getAttributeCarriers()->generateAdditionalID(polygonUnderMouse->getTagProperty().getTag())); + basePolygon->addPositionVectorAttribute(SUMO_ATTR_SHAPE, triangle.getShape()); + // build shape + additionalHandler.parseSumoBaseObject(basePolygon); + } + // delete original polygon + myNet->deleteAdditional(polygonUnderMouse, myNet->getViewNet()->getUndoList()); + // end undo-list + myNet->getViewNet()->getUndoList()->end(); + } + return 1; +} + + long GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) { GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition(); diff --git a/src/netedit/GNEViewNet.h b/src/netedit/GNEViewNet.h index b534fc3c0f24..b93d9014175e 100644 --- a/src/netedit/GNEViewNet.h +++ b/src/netedit/GNEViewNet.h @@ -259,6 +259,9 @@ class GNEViewNet : public GUISUMOAbstractView { /// @brief select elements within polygon boundary long onCmdSelectPolygonElements(FXObject*, FXSelector, void*); + /// @brief triangulate polygon + long onCmdTriangulatePolygon(FXObject*, FXSelector, void*); + /// @brief set as first geometry point the closes geometry point long onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*); diff --git a/src/netedit/elements/additional/GNEPoly.cpp b/src/netedit/elements/additional/GNEPoly.cpp index 6d7c1f1028d6..7510c344f483 100644 --- a/src/netedit/elements/additional/GNEPoly.cpp +++ b/src/netedit/elements/additional/GNEPoly.cpp @@ -275,6 +275,9 @@ GNEPoly::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { } } GUIDesigns::buildFXMenuCommand(ret, TL("Select elements within polygon"), TL("Select elements within polygon boundary"), nullptr, &parent, MID_GNE_POLYGON_SELECT); + if (myShape.size() > 3) { + GUIDesigns::buildFXMenuCommand(ret, TL("Triangulate polygon"), TL("Convert the current polygon in triangles"), nullptr, &parent, MID_GNE_POLYGON_TRIANGULATE); + } // add separator new FXMenuSeparator(ret); // create a extra FXMenuCommand if mouse is over a vertex @@ -518,6 +521,27 @@ GNEPoly::simplifyShape(bool allowUndo) { } +CommonXMLStructure::SumoBaseObject* +GNEPoly::getSumoBaseObject() const { + CommonXMLStructure::SumoBaseObject* polygonBaseObject = new CommonXMLStructure::SumoBaseObject(nullptr); + polygonBaseObject->setTag(myTagProperty.getTag()); + // fill attributes + polygonBaseObject->addStringAttribute(SUMO_ATTR_ID, myID); + polygonBaseObject->addPositionVectorAttribute(SUMO_ATTR_SHAPE, myShape); + polygonBaseObject->addBoolAttribute(SUMO_ATTR_GEO, myGEO); + polygonBaseObject->addBoolAttribute(SUMO_ATTR_FILL, myFill); + polygonBaseObject->addDoubleAttribute(SUMO_ATTR_LINEWIDTH, myLineWidth); + polygonBaseObject->addColorAttribute(SUMO_ATTR_COLOR, getShapeColor()); + polygonBaseObject->addStringAttribute(SUMO_ATTR_TYPE, getShapeType()); + polygonBaseObject->addDoubleAttribute(SUMO_ATTR_LAYER, getShapeLayer()); + polygonBaseObject->addStringAttribute(SUMO_ATTR_IMGFILE, getShapeImgFile()); + polygonBaseObject->addDoubleAttribute(SUMO_ATTR_ANGLE, getShapeNaviDegree()); + polygonBaseObject->addStringAttribute(SUMO_ATTR_NAME, getShapeName()); + polygonBaseObject->addBoolAttribute(SUMO_ATTR_RELATIVEPATH, getShapeRelativePath()); + return polygonBaseObject; +} + + std::string GNEPoly::getAttribute(SumoXMLAttr key) const { switch (key) { diff --git a/src/netedit/elements/additional/GNEPoly.h b/src/netedit/elements/additional/GNEPoly.h index 897d1930ec17..8891134871b3 100644 --- a/src/netedit/elements/additional/GNEPoly.h +++ b/src/netedit/elements/additional/GNEPoly.h @@ -21,6 +21,7 @@ #pragma once #include #include +#include #include "GNEAdditional.h" @@ -231,6 +232,9 @@ class GNEPoly : public TesselatedPolygon, public GNEAdditional { /// @brief replace the current shape with a rectangle void simplifyShape(bool allowUndo = true); + /// @brief get SUMOBaseObject with all polygon attributes + CommonXMLStructure::SumoBaseObject* getSumoBaseObject() const; + protected: /// @brief Latitude of Polygon PositionVector myGeoShape; diff --git a/src/utils/geom/Triangle.cpp b/src/utils/geom/Triangle.cpp index 77f3065ba671..d91d32e11e27 100644 --- a/src/utils/geom/Triangle.cpp +++ b/src/utils/geom/Triangle.cpp @@ -103,6 +103,12 @@ Triangle::getBoundary() const { } +const PositionVector +Triangle::getShape() const { + return PositionVector({myA, myB, myC}); +} + + std::vector Triangle::triangulate(PositionVector shape) { std::vector triangles; diff --git a/src/utils/geom/Triangle.h b/src/utils/geom/Triangle.h index 59544c76b908..c03e9fbe815b 100644 --- a/src/utils/geom/Triangle.h +++ b/src/utils/geom/Triangle.h @@ -46,6 +46,9 @@ class Triangle { /// @brief get triangle boundary const Boundary &getBoundary() const; + + /// @brief get shape boundary + const PositionVector getShape() const; /// @brief check if the given position is within this triangle bool isAroundPosition(const Position &pos) const; diff --git a/src/utils/gui/windows/GUIAppEnum.h b/src/utils/gui/windows/GUIAppEnum.h index 50612389634b..fc313842eb51 100644 --- a/src/utils/gui/windows/GUIAppEnum.h +++ b/src/utils/gui/windows/GUIAppEnum.h @@ -1323,6 +1323,8 @@ enum { MID_GNE_POLYGON_DELETE_GEOMETRY_POINT, /// @brief select elements within polygon boundary MID_GNE_POLYGON_SELECT, + /// @brief triangulate polygon + MID_GNE_POLYGON_TRIANGULATE, /// @} From 8043661e243335ad2b6ea9c83ba0c9ae78cd7f0f Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Mon, 20 Jan 2025 14:06:03 +0100 Subject: [PATCH 029/116] Improved triangulation of polygons. Refs #15844 --- src/utils/geom/Triangle.cpp | 65 +++++++++++++++++++++++++++++-------- src/utils/geom/Triangle.h | 16 +++++++-- 2 files changed, 65 insertions(+), 16 deletions(-) diff --git a/src/utils/geom/Triangle.cpp b/src/utils/geom/Triangle.cpp index d91d32e11e27..01bbe189a6fb 100644 --- a/src/utils/geom/Triangle.cpp +++ b/src/utils/geom/Triangle.cpp @@ -46,13 +46,7 @@ Triangle::~Triangle() {} bool Triangle::isAroundPosition(const Position &pos) const { - // Calculate cross products for each edge of the triangle - const double crossAB = crossProduct(myA, myB, pos); - const double crossBC = crossProduct(myB, myC, pos); - const double crossCA = crossProduct(myC, myA, pos); - // Check if all cross products have the same sign - return (crossAB >= 0 && crossBC >= 0 && crossCA >= 0) || - (crossAB <= 0 && crossBC <= 0 && crossCA <= 0); + return isAroundPosition(myA, myB, myC, pos); } @@ -118,8 +112,25 @@ Triangle::triangulate(PositionVector shape) { if (shape.size() >= 3) { // greedy algorithm while (shape.size() > 3) { - triangles.push_back(Triangle(shape[0], shape[1], shape[2])); - shape.erase(shape.begin() + 1); + int shapeSize = (int)shape.size(); + int earIndex = -1; + // first find an "ear" + for (int i = 0; (i != shapeSize) && (earIndex == -1); i++) { + const auto &earA = shape[(i + shapeSize - 1) % shapeSize]; + const auto &earB = shape[i]; + const auto &earC = shape[(i + 1) % shapeSize]; + if (isEar(earA, earB, earC, shape)) { + earIndex = i; + } + } + if (earIndex != -1) { + triangles.push_back(Triangle(shape[earIndex-1], shape[earIndex], shape[earIndex+1])); + shape.erase(shape.begin() + earIndex); + } else { + // simply remove the first three + triangles.push_back(Triangle(shape[0], shape[1], shape[2])); + shape.erase(shape.begin() + 1); + } } // add last triangle triangles.push_back(Triangle(shape[0], shape[1], shape[2])); @@ -128,15 +139,43 @@ Triangle::triangulate(PositionVector shape) { } +bool +Triangle::isAroundPosition(const Position &A, const Position &B, const Position &C, const Position &pos) { + // Calculate cross products for each edge of the triangle + const double crossAB = crossProduct(A, B, pos); + const double crossBC = crossProduct(B, C, pos); + const double crossCA = crossProduct(C, A, pos); + // Check if all cross products have the same sign + return (crossAB >= 0 && crossBC >= 0 && crossCA >= 0) || + (crossAB <= 0 && crossBC <= 0 && crossCA <= 0); +} + + +bool +Triangle::isEar(const Position& a, const Position& b, const Position& c, const PositionVector& shape) { + // Check if triangle ABC is counter-clockwise + if (crossProduct(a, b, c) <= 0) { + return false; + } + // Check if any other point in the polygon lies inside the triangle + for (const auto& pos : shape) { + if ((pos != a) && (pos != b) && (pos != c) && isAroundPosition(a, b, c, pos)) { + return false; + } + } + return true; +} + + double -Triangle::calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) const { - return std::abs((a.x() * (b.y() - c.y()) + b.x() * (c.y() - a.y()) + c.x() * (a.y() - b.y())) / 2.0); +Triangle::crossProduct(const Position& a, const Position& b, const Position& c) { + return (b.x() - a.x()) * (c.y() - a.y()) - (b.y() - a.y()) * (c.x() - a.x()); } double -Triangle::crossProduct(const Position& A, const Position& B, const Position& C) const { - return (B.x() - A.x()) * (C.y() - A.y()) - (B.y() - A.y()) * (C.x() - A.x()); +Triangle::calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) const { + return std::abs((a.x() * (b.y() - c.y()) + b.x() * (c.y() - a.y()) + c.x() * (a.y() - b.y())) / 2.0); } diff --git a/src/utils/geom/Triangle.h b/src/utils/geom/Triangle.h index c03e9fbe815b..be5fd1edfb4b 100644 --- a/src/utils/geom/Triangle.h +++ b/src/utils/geom/Triangle.h @@ -66,11 +66,21 @@ class Triangle { static std::vector triangulate(PositionVector shape); private: - /// @brief calculate triangle area (2D) - double calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) const; + /// @name functions used for triangulating + /// @{ + /// @brief check if the given position is within this triangle + static bool isAroundPosition(const Position &A, const Position &B, const Position &C, const Position &pos); + + // Check if the triangle (A, B, C) is an ear + static bool isEar(const Position& a, const Position& b, const Position& c, const PositionVector& shape); /// @brief calculate cross product of the given points - double crossProduct(const Position& A, const Position& B, const Position& C) const; + static double crossProduct(const Position& a, const Position& b, const Position& c); + + /// @} + + /// @brief calculate triangle area (2D) + double calculateTriangleArea2D(const Position& a, const Position& b, const Position& c) const; /// @brief function to check if line between posA and posB intersect circle bool lineIntersectCircle(const Position& posA, const Position& posB, const Position& center, const double radius) const; From e7f71a7053e2df58ef5af74f3193729f69a9ef72 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Mon, 20 Jan 2025 15:19:30 +0100 Subject: [PATCH 030/116] Fixed crash during triangulate. Refs #15844 --- src/utils/geom/Triangle.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils/geom/Triangle.cpp b/src/utils/geom/Triangle.cpp index 01bbe189a6fb..e92f989349d9 100644 --- a/src/utils/geom/Triangle.cpp +++ b/src/utils/geom/Triangle.cpp @@ -67,8 +67,6 @@ Triangle::isAroundShape(const PositionVector &shape) const { bool Triangle::isBoundaryAround(const Boundary &boundary) const { if (isAroundPosition(Position(boundary.xmin(), boundary.ymin())) && - isAroundPosition(Position(boundary.xmin(), boundary.ymax())) && - isAroundPosition(Position(boundary.xmax(), boundary.ymin())) && isAroundPosition(Position(boundary.xmax(), boundary.ymax()))) { return true; } else { @@ -115,7 +113,7 @@ Triangle::triangulate(PositionVector shape) { int shapeSize = (int)shape.size(); int earIndex = -1; // first find an "ear" - for (int i = 0; (i != shapeSize) && (earIndex == -1); i++) { + for (int i = 0; (i < shapeSize) && (earIndex == -1); i++) { const auto &earA = shape[(i + shapeSize - 1) % shapeSize]; const auto &earB = shape[i]; const auto &earC = shape[(i + 1) % shapeSize]; @@ -124,7 +122,11 @@ Triangle::triangulate(PositionVector shape) { } } if (earIndex != -1) { - triangles.push_back(Triangle(shape[earIndex-1], shape[earIndex], shape[earIndex+1])); + triangles.push_back(Triangle( + shape[(earIndex + shapeSize - 1) % shapeSize], + shape[earIndex], + shape[(earIndex + 1) % shapeSize]) + ); shape.erase(shape.begin() + earIndex); } else { // simply remove the first three From f235c91731223b7a33fd94f5cfebfa7e81429faa Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Mon, 20 Jan 2025 15:40:04 +0100 Subject: [PATCH 031/116] Minor update in GNETAZFrame. Refs #15844 --- src/netedit/frames/network/GNETAZFrame.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/netedit/frames/network/GNETAZFrame.cpp b/src/netedit/frames/network/GNETAZFrame.cpp index dc289b0e3e85..ec00e04f4fd4 100644 --- a/src/netedit/frames/network/GNETAZFrame.cpp +++ b/src/netedit/frames/network/GNETAZFrame.cpp @@ -1636,6 +1636,8 @@ GNETAZFrame::shapeDrawed() { for (const auto &triangle : triangulation) { // update objects in boundary myViewNet->updateObjectsInBoundary(triangle.getBoundary()); + // resize to improve efficiency + edgeIDs.reserve(edgeIDs.size() + myViewNet->getViewObjectsSelector().getEdges().size()); // get only edges with geometry around triangle for (const auto& edge : myViewNet->getViewObjectsSelector().getEdges()) { if (myViewNet->getNet()->getAttributeCarriers()->isNetworkElementAroundTriangle(edge, triangle)) { From 7bfaa259c473298dcb591f15059cf5cbf1ae6811 Mon Sep 17 00:00:00 2001 From: Robert Hilbrich Date: Mon, 20 Jan 2025 17:29:54 +0100 Subject: [PATCH 032/116] adding signing of binaries, refs #15213 --- tools/build_config/buildMacOSInstaller.py | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tools/build_config/buildMacOSInstaller.py b/tools/build_config/buildMacOSInstaller.py index dcfdd8654004..6e669dc5283b 100755 --- a/tools/build_config/buildMacOSInstaller.py +++ b/tools/build_config/buildMacOSInstaller.py @@ -124,6 +124,51 @@ def create_installer_conclusion_content(framework_name): return html +def sign_file(file_path): + """Signs a file using the specified signing service.""" + signing_service_url = "https://cbi.eclipse.org/macos/codesign/sign" + signed_file_path = f"{file_path}-signed" + + # Create a temporary entitlements file + with tempfile.NamedTemporaryFile(delete=False, suffix=".entitlement") as temp_entitlements: + temp_entitlements.write(b''' + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.disable-executable-page-protection + + com.apple.security.cs.allow-dyld-environment-variables + + com.apple.security.cs.disable-library-validation + + com.apple.security.cs.debugger + + + +''') + + try: + command = [ + "curl", + "-o", signed_file_path, + "-F", f"file=@{file_path}", + "-F", f"entitlements=@{temp_entitlements.name}", + signing_service_url, + ] + result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) + if result.returncode != 0: + raise RuntimeError(f"Failed to sign file {file_path}: {result.stderr}") + if not os.path.exists(signed_file_path): + raise FileNotFoundError(f"Signed file not created: {signed_file_path}") + return signed_file_path + finally: + os.remove(temp_entitlements.name) + + def create_framework(name, longname, pkg_id, version, sumo_build_directory): print(" - Creating directory structure") temp_dir = tempfile.mkdtemp() @@ -214,6 +259,16 @@ def create_framework(name, longname, pkg_id, version, sumo_build_directory): for file in proj_file_list: shutil.copy2(os.path.join(source_dir, file), os.path.join(dest_dir, file)) + # Signing the binaries and libraries + print(" - Signing binaries and libraries") + for dir_path in [bin_dir, lib_dir]: + for file in os.listdir(dir_path): + file_path = os.path.join(dir_path, file) + if os.path.isfile(file_path): + print(f" . Signing {file_path}...") + signed_file_path = sign_file(file_path) + shutil.move(signed_file_path, file_path) + # Build the framework package cwd = os.path.dirname(os.path.abspath(__file__)) pkg_name = f"{name}-{version}.pkg" From 92e75aa0ef4a795d95fa48e7ee73daf15d6fb65a Mon Sep 17 00:00:00 2001 From: Robert Hilbrich Date: Mon, 20 Jan 2025 17:54:03 +0100 Subject: [PATCH 033/116] testing staging cbi service, refs #15213 --- tools/build_config/buildMacOSInstaller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_config/buildMacOSInstaller.py b/tools/build_config/buildMacOSInstaller.py index 6e669dc5283b..231c768b07fb 100755 --- a/tools/build_config/buildMacOSInstaller.py +++ b/tools/build_config/buildMacOSInstaller.py @@ -126,7 +126,7 @@ def create_installer_conclusion_content(framework_name): def sign_file(file_path): """Signs a file using the specified signing service.""" - signing_service_url = "https://cbi.eclipse.org/macos/codesign/sign" + signing_service_url = "https://cbi-staging.eclipse.org/macos/codesign/sign" signed_file_path = f"{file_path}-signed" # Create a temporary entitlements file From 4d5e58e3fa8f03ee709aae65f2b03dfb2937c557 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Mon, 20 Jan 2025 16:17:15 +0100 Subject: [PATCH 034/116] Added GNEChildContainer. Refs #16039 --- src/netedit/elements/CMakeLists.txt | 2 + src/netedit/elements/GNEChildContainer.cpp | 433 ++++++++++++++++++ src/netedit/elements/GNEChildContainer.h | 129 ++++++ .../elements/GNEHierarchicalContainer.cpp | 11 +- .../elements/GNEHierarchicalContainer.h | 1 + 5 files changed, 573 insertions(+), 3 deletions(-) create mode 100644 src/netedit/elements/GNEChildContainer.cpp create mode 100644 src/netedit/elements/GNEChildContainer.h diff --git a/src/netedit/elements/CMakeLists.txt b/src/netedit/elements/CMakeLists.txt index 5f66b868e077..483a90719dc0 100644 --- a/src/netedit/elements/CMakeLists.txt +++ b/src/netedit/elements/CMakeLists.txt @@ -16,6 +16,8 @@ set(netedit_elements_SRCS GNEGeneralHandler.h GNEHierarchicalContainer.cpp GNEHierarchicalContainer.h + GNEChildContainer.cpp + GNEChildContainer.h GNEHierarchicalElement.cpp GNEHierarchicalElement.h GNEPathElement.cpp diff --git a/src/netedit/elements/GNEChildContainer.cpp b/src/netedit/elements/GNEChildContainer.cpp new file mode 100644 index 000000000000..ccad68cdd29f --- /dev/null +++ b/src/netedit/elements/GNEChildContainer.cpp @@ -0,0 +1,433 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo +// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0/ +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License 2.0 are satisfied: GNU General Public License, version 2 +// or later which is available at +// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later +/****************************************************************************/ +/// @file GNEChildContainer.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2025 +/// +// Container for GNEHierarchical child elements +/****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "GNEChildContainer.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEChildContainer::GNEChildContainer() {} + + +GNEChildContainer::GNEChildContainer( + const std::vector& parentJunctions, + const std::vector& parentEdges, + const std::vector& parentLanes, + const std::vector& parentAdditionals, + const std::vector& ParentDemandElements, + const std::vector& parentGenericDatas): + myParentJunctions(parentJunctions), + myParentEdges(parentEdges), + myParentLanes(parentLanes), + myParentAdditionals(parentAdditionals), + myParentDemandElements(ParentDemandElements), + myParentGenericDatas(parentGenericDatas) { +} + + +size_t +GNEChildContainer::getContainerSize() const { + return ( + myParentJunctions.size() + + myParentEdges.size() + + myParentLanes.size() + + myParentAdditionals.size() + + myParentDemandElements.size() + + myParentGenericDatas.size() + + myChildJunctions.size() + + myChildEdges.size() + + myChildLanes.size() + + myChildAdditionals.size() + + myChildDemandElements.size() + + myChildGenericDatas.size() + ); +} + + +template <> void +GNEChildContainer::addParentElement(GNEJunction* junction) { + myParentJunctions.push_back(junction); +} + + +template <> void +GNEChildContainer::addParentElement(GNEEdge* edge) { + myParentEdges.push_back(edge); +} + + +template <> void +GNEChildContainer::addParentElement(GNELane* lane) { + myParentLanes.push_back(lane); +} + + +template <> void +GNEChildContainer::addParentElement(GNEAdditional* additional) { + myParentAdditionals.push_back(additional); +} + + +template <> void +GNEChildContainer::addParentElement(GNEDemandElement* demandElement) { + myParentDemandElements.push_back(demandElement); +} + + +template <> void +GNEChildContainer::addParentElement(GNEGenericData* genericData) { + myParentGenericDatas.push_back(genericData); +} + + +template <> void +GNEChildContainer::removeParentElement(GNEJunction* junction) { + // check junction + auto it = std::find(myParentJunctions.begin(), myParentJunctions.end(), junction); + if (it == myParentJunctions.end()) { + throw ProcessError(junction->getTagStr() + " with ID='" + junction->getID() + "' is not a parent element"); + } else { + myParentJunctions.erase(it); + } +} + + +template <> void +GNEChildContainer::removeParentElement(GNEEdge* edge) { + // check edge + auto it = std::find(myParentEdges.begin(), myParentEdges.end(), edge); + if (it == myParentEdges.end()) { + throw ProcessError(edge->getTagStr() + " with ID='" + edge->getID() + "' is not a parent element"); + } else { + myParentEdges.erase(it); + } +} + + +template <> void +GNEChildContainer::removeParentElement(GNELane* lane) { + // check lane + auto it = std::find(myParentLanes.begin(), myParentLanes.end(), lane); + if (it == myParentLanes.end()) { + throw ProcessError(lane->getTagStr() + " with ID='" + lane->getID() + "' is not a parent element"); + } else { + myParentLanes.erase(it); + } +} + + +template <> void +GNEChildContainer::removeParentElement(GNEAdditional* additional) { + // check additional + auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional); + if (it == myParentAdditionals.end()) { + throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' is not a parent element"); + } else { + myParentAdditionals.erase(it); + } +} + + +template <> void +GNEChildContainer::removeParentElement(GNEDemandElement* demandElement) { + // check TAZElement + auto it = std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement); + if (it == myParentDemandElements.end()) { + throw ProcessError(demandElement->getTagStr() + " is not a parent element"); + } else { + myParentDemandElements.erase(it); + } +} + + +template <> void +GNEChildContainer::removeParentElement(GNEGenericData* genericData) { + // check generic data + auto it = std::find(myParentGenericDatas.begin(), myParentGenericDatas.end(), genericData); + if (it == myParentGenericDatas.end()) { + throw ProcessError(genericData->getTagStr() + " is not a parent element"); + } else { + myParentGenericDatas.erase(it); + } +} + + +template <> void +GNEChildContainer::addChildElement(GNEJunction* junction) { + myChildJunctions.push_back(junction); +} + + +template <> void +GNEChildContainer::addChildElement(GNEEdge* edge) { + myChildEdges.push_back(edge); +} + + +template <> void +GNEChildContainer::addChildElement(GNELane* lane) { + myChildLanes.push_back(lane); +} + + +template <> void +GNEChildContainer::addChildElement(GNEAdditional* additional) { + myChildAdditionals.push_back(additional); +} + + +template <> void +GNEChildContainer::addChildElement(GNEDemandElement* demandElement) { + myChildDemandElements.push_back(demandElement); + +} + + +template <> void +GNEChildContainer::addChildElement(GNEGenericData* genericData) { + myChildGenericDatas.push_back(genericData); +} + + +template <> void +GNEChildContainer::removeChildElement(GNEJunction* junction) { + // check junction + auto it = std::find(myChildJunctions.begin(), myChildJunctions.end(), junction); + if (it == myChildJunctions.end()) { + throw ProcessError(junction->getTagStr() + " is not a child element"); + } else { + myChildJunctions.erase(it); + } +} + + +template <> void +GNEChildContainer::removeChildElement(GNEEdge* edge) { + // check edge + auto it = std::find(myChildEdges.begin(), myChildEdges.end(), edge); + if (it == myChildEdges.end()) { + throw ProcessError(edge->getTagStr() + " is not a child element"); + } else { + myChildEdges.erase(it); + } +} + + +template <> void +GNEChildContainer::removeChildElement(GNELane* lane) { + // check lane + auto it = std::find(myChildLanes.begin(), myChildLanes.end(), lane); + if (it == myChildLanes.end()) { + throw ProcessError(lane->getTagStr() + " is not a child element"); + } else { + myChildLanes.erase(it); + } +} + + +template <> void +GNEChildContainer::removeChildElement(GNEAdditional* additional) { + // check additional + auto it = std::find(myChildAdditionals.begin(), myChildAdditionals.end(), additional); + if (it == myChildAdditionals.end()) { + throw ProcessError(additional->getTagStr() + " is not a child element"); + } else { + myChildAdditionals.erase(it); + } +} + + +template <> void +GNEChildContainer::removeChildElement(GNEDemandElement* demandElement) { + // check demand element + auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); + if (it == myChildDemandElements.end()) { + throw ProcessError(demandElement->getTagStr() + " is not a child element"); + } else { + myChildDemandElements.erase(it); + } +} + + +template <> void +GNEChildContainer::removeChildElement(GNEGenericData* genericData) { + // check generic data + auto it = std::find(myChildGenericDatas.begin(), myChildGenericDatas.end(), genericData); + if (it == myChildGenericDatas.end()) { + throw ProcessError(genericData->getTagStr() + " is not a child element"); + } else { + myChildGenericDatas.erase(it); + } +} + + +template<> const std::vector& +GNEChildContainer::getParents() const { + return myParentJunctions; +} + + +template<> const std::vector& +GNEChildContainer::getParents() const { + return myParentEdges; +} + + +template<> const std::vector& +GNEChildContainer::getParents() const { + return myParentLanes; +} + + +template<> const std::vector& +GNEChildContainer::getParents() const { + return myParentAdditionals; +} + + +template<> const std::vector& +GNEChildContainer::getParents() const { + return myParentDemandElements; +} + + +template<> const std::vector& +GNEChildContainer::getParents() const { + return myParentGenericDatas; +} + + +template<> void +GNEChildContainer::setParents(const std::vector& newParents) { + myParentJunctions = newParents; +} + + +template<> void +GNEChildContainer::setParents(const std::vector& newParents) { + myParentEdges = newParents; +} + + +template<> void +GNEChildContainer::setParents(const std::vector& newParents) { + myParentLanes = newParents; +} + + +template<> void +GNEChildContainer::setParents(const std::vector& newParents) { + myParentAdditionals = newParents; +} + + +template<> void +GNEChildContainer::setParents(const std::vector& newParents) { + myParentDemandElements = newParents; +} + + +template<> void +GNEChildContainer::setParents(const std::vector& newParents) { + myParentGenericDatas = newParents; +} + + +template<> const std::vector& +GNEChildContainer::getChildren() const { + return myChildJunctions; +} + + +template<> const std::vector& +GNEChildContainer::getChildren() const { + return myChildEdges; +} + + +template<> const std::vector& +GNEChildContainer::getChildren() const { + return myChildLanes; +} + + +template<> const std::vector& +GNEChildContainer::getChildren() const { + return myChildAdditionals; +} + + +template<> const std::vector& +GNEChildContainer::getChildren() const { + return myChildDemandElements; +} + + +template<> const std::vector& +GNEChildContainer::getChildren() const { + return myChildGenericDatas; +} + + +template<> void +GNEChildContainer::setChildren(const std::vector& newChildren) { + myChildJunctions = newChildren; +} + + +template<> void +GNEChildContainer::setChildren(const std::vector& newChildren) { + myChildEdges = newChildren; +} + + +template<> void +GNEChildContainer::setChildren(const std::vector& newChildren) { + myChildLanes = newChildren; +} + + +template<> void +GNEChildContainer::setChildren(const std::vector& newChildren) { + myChildAdditionals = newChildren; +} + + +template<> void +GNEChildContainer::setChildren(const std::vector& newChildren) { + myChildDemandElements = newChildren; +} + + +template<> void +GNEChildContainer::setChildren(const std::vector& newChildren) { + myChildGenericDatas = newChildren; +} + +/****************************************************************************/ diff --git a/src/netedit/elements/GNEChildContainer.h b/src/netedit/elements/GNEChildContainer.h new file mode 100644 index 000000000000..afa3f4917ddc --- /dev/null +++ b/src/netedit/elements/GNEChildContainer.h @@ -0,0 +1,129 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo +// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0/ +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License 2.0 are satisfied: GNU General Public License, version 2 +// or later which is available at +// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later +/****************************************************************************/ +/// @file GNEChildContainer.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2025 +/// +// Container for GNEHierarchical child elements +/****************************************************************************/ +#pragma once +#include + +#include + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNENetworkElement; +class GNEJunction; +class GNEEdge; +class GNELane; +class GNEAdditional; +class GNEDemandElement; +class GNEGenericData; +class GNEHierarchicalElement; + +// =========================================================================== +// class definitions +// =========================================================================== + +/// @brief Hierarchical container (used for keep myParent and myChildren +class GNEChildContainer { + +public: + /// @brief default constructor + GNEChildContainer(); + + /// @brief parameter constructor (only for parents) + GNEChildContainer( + const std::vector& parentJunctions, + const std::vector& parentEdges, + const std::vector& parentLanes, + const std::vector& parentAdditionals, + const std::vector& ParentDemandElements, + const std::vector& parentGenericDatas); + + /// @brief get container size + size_t getContainerSize() const; + + /// @brief add parent element + template + void addParentElement(T* element); + + /// @brief remove parent element + template + void removeParentElement(T* element); + + /// @brief add child element + template + void addChildElement(T* element); + + /// @brief remove child element + template + void removeChildElement(T* element); + + /// @brief get parents + template + const T& getParents() const; + + /// @brief set parents + template + void setParents(const T& newParents); + + /// @brief get children + template + const T& getChildren() const; + + /// @brief set children + template + void setChildren(const T& newChildren); + +private: + /// @brief vector of parent junctions + std::vector myParentJunctions; + + /// @brief vector of parent edges + std::vector myParentEdges; + + /// @brief vector of parent lanes + std::vector myParentLanes; + + /// @brief vector of parent additionals + std::vector myParentAdditionals; + + /// @brief vector of parent demand elements + std::vector myParentDemandElements; + + /// @brief vector of parent generic datas + std::vector myParentGenericDatas; + + /// @brief vector with the child junctions + std::vector myChildJunctions; + + /// @brief vector with the child edges + std::vector myChildEdges; + + /// @brief vector with the child lanes + std::vector myChildLanes; + + /// @brief vector with the child additional + std::vector myChildAdditionals; + + /// @brief vector with the child demand elements + std::vector myChildDemandElements; + + /// @brief vector with the generic child data elements + std::vector myChildGenericDatas; +}; diff --git a/src/netedit/elements/GNEHierarchicalContainer.cpp b/src/netedit/elements/GNEHierarchicalContainer.cpp index 485b1d417d9f..34f6f08855ed 100644 --- a/src/netedit/elements/GNEHierarchicalContainer.cpp +++ b/src/netedit/elements/GNEHierarchicalContainer.cpp @@ -17,11 +17,16 @@ /// // Container for GNEHierarchicalElements /****************************************************************************/ -#include -#include +#include +#include +#include +#include +#include +#include +#include -#define CHECK_DUPLICATES +#include "GNEHierarchicalContainer.h" // =========================================================================== // member method definitions diff --git a/src/netedit/elements/GNEHierarchicalContainer.h b/src/netedit/elements/GNEHierarchicalContainer.h index 86bfc9fdece7..ba383160ec77 100644 --- a/src/netedit/elements/GNEHierarchicalContainer.h +++ b/src/netedit/elements/GNEHierarchicalContainer.h @@ -20,6 +20,7 @@ #pragma once #include +#include // =========================================================================== // class declarations From f9bb81950782b4be68fcf986c921827856902930 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 08:53:38 +0100 Subject: [PATCH 035/116] Now GNEChildContainer is a template. Refs #16039 --- src/netedit/elements/CMakeLists.txt | 1 - src/netedit/elements/GNEChildContainer.cpp | 433 --------------------- src/netedit/elements/GNEChildContainer.h | 84 +--- 3 files changed, 10 insertions(+), 508 deletions(-) delete mode 100644 src/netedit/elements/GNEChildContainer.cpp diff --git a/src/netedit/elements/CMakeLists.txt b/src/netedit/elements/CMakeLists.txt index 483a90719dc0..c5fda76092d0 100644 --- a/src/netedit/elements/CMakeLists.txt +++ b/src/netedit/elements/CMakeLists.txt @@ -16,7 +16,6 @@ set(netedit_elements_SRCS GNEGeneralHandler.h GNEHierarchicalContainer.cpp GNEHierarchicalContainer.h - GNEChildContainer.cpp GNEChildContainer.h GNEHierarchicalElement.cpp GNEHierarchicalElement.h diff --git a/src/netedit/elements/GNEChildContainer.cpp b/src/netedit/elements/GNEChildContainer.cpp deleted file mode 100644 index ccad68cdd29f..000000000000 --- a/src/netedit/elements/GNEChildContainer.cpp +++ /dev/null @@ -1,433 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo -// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are made available under the -// terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0/ -// This Source Code may also be made available under the following Secondary -// Licenses when the conditions for such availability set forth in the Eclipse -// Public License 2.0 are satisfied: GNU General Public License, version 2 -// or later which is available at -// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later -/****************************************************************************/ -/// @file GNEChildContainer.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2025 -/// -// Container for GNEHierarchical child elements -/****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#include "GNEChildContainer.h" - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEChildContainer::GNEChildContainer() {} - - -GNEChildContainer::GNEChildContainer( - const std::vector& parentJunctions, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentAdditionals, - const std::vector& ParentDemandElements, - const std::vector& parentGenericDatas): - myParentJunctions(parentJunctions), - myParentEdges(parentEdges), - myParentLanes(parentLanes), - myParentAdditionals(parentAdditionals), - myParentDemandElements(ParentDemandElements), - myParentGenericDatas(parentGenericDatas) { -} - - -size_t -GNEChildContainer::getContainerSize() const { - return ( - myParentJunctions.size() + - myParentEdges.size() + - myParentLanes.size() + - myParentAdditionals.size() + - myParentDemandElements.size() + - myParentGenericDatas.size() + - myChildJunctions.size() + - myChildEdges.size() + - myChildLanes.size() + - myChildAdditionals.size() + - myChildDemandElements.size() + - myChildGenericDatas.size() - ); -} - - -template <> void -GNEChildContainer::addParentElement(GNEJunction* junction) { - myParentJunctions.push_back(junction); -} - - -template <> void -GNEChildContainer::addParentElement(GNEEdge* edge) { - myParentEdges.push_back(edge); -} - - -template <> void -GNEChildContainer::addParentElement(GNELane* lane) { - myParentLanes.push_back(lane); -} - - -template <> void -GNEChildContainer::addParentElement(GNEAdditional* additional) { - myParentAdditionals.push_back(additional); -} - - -template <> void -GNEChildContainer::addParentElement(GNEDemandElement* demandElement) { - myParentDemandElements.push_back(demandElement); -} - - -template <> void -GNEChildContainer::addParentElement(GNEGenericData* genericData) { - myParentGenericDatas.push_back(genericData); -} - - -template <> void -GNEChildContainer::removeParentElement(GNEJunction* junction) { - // check junction - auto it = std::find(myParentJunctions.begin(), myParentJunctions.end(), junction); - if (it == myParentJunctions.end()) { - throw ProcessError(junction->getTagStr() + " with ID='" + junction->getID() + "' is not a parent element"); - } else { - myParentJunctions.erase(it); - } -} - - -template <> void -GNEChildContainer::removeParentElement(GNEEdge* edge) { - // check edge - auto it = std::find(myParentEdges.begin(), myParentEdges.end(), edge); - if (it == myParentEdges.end()) { - throw ProcessError(edge->getTagStr() + " with ID='" + edge->getID() + "' is not a parent element"); - } else { - myParentEdges.erase(it); - } -} - - -template <> void -GNEChildContainer::removeParentElement(GNELane* lane) { - // check lane - auto it = std::find(myParentLanes.begin(), myParentLanes.end(), lane); - if (it == myParentLanes.end()) { - throw ProcessError(lane->getTagStr() + " with ID='" + lane->getID() + "' is not a parent element"); - } else { - myParentLanes.erase(it); - } -} - - -template <> void -GNEChildContainer::removeParentElement(GNEAdditional* additional) { - // check additional - auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional); - if (it == myParentAdditionals.end()) { - throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' is not a parent element"); - } else { - myParentAdditionals.erase(it); - } -} - - -template <> void -GNEChildContainer::removeParentElement(GNEDemandElement* demandElement) { - // check TAZElement - auto it = std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement); - if (it == myParentDemandElements.end()) { - throw ProcessError(demandElement->getTagStr() + " is not a parent element"); - } else { - myParentDemandElements.erase(it); - } -} - - -template <> void -GNEChildContainer::removeParentElement(GNEGenericData* genericData) { - // check generic data - auto it = std::find(myParentGenericDatas.begin(), myParentGenericDatas.end(), genericData); - if (it == myParentGenericDatas.end()) { - throw ProcessError(genericData->getTagStr() + " is not a parent element"); - } else { - myParentGenericDatas.erase(it); - } -} - - -template <> void -GNEChildContainer::addChildElement(GNEJunction* junction) { - myChildJunctions.push_back(junction); -} - - -template <> void -GNEChildContainer::addChildElement(GNEEdge* edge) { - myChildEdges.push_back(edge); -} - - -template <> void -GNEChildContainer::addChildElement(GNELane* lane) { - myChildLanes.push_back(lane); -} - - -template <> void -GNEChildContainer::addChildElement(GNEAdditional* additional) { - myChildAdditionals.push_back(additional); -} - - -template <> void -GNEChildContainer::addChildElement(GNEDemandElement* demandElement) { - myChildDemandElements.push_back(demandElement); - -} - - -template <> void -GNEChildContainer::addChildElement(GNEGenericData* genericData) { - myChildGenericDatas.push_back(genericData); -} - - -template <> void -GNEChildContainer::removeChildElement(GNEJunction* junction) { - // check junction - auto it = std::find(myChildJunctions.begin(), myChildJunctions.end(), junction); - if (it == myChildJunctions.end()) { - throw ProcessError(junction->getTagStr() + " is not a child element"); - } else { - myChildJunctions.erase(it); - } -} - - -template <> void -GNEChildContainer::removeChildElement(GNEEdge* edge) { - // check edge - auto it = std::find(myChildEdges.begin(), myChildEdges.end(), edge); - if (it == myChildEdges.end()) { - throw ProcessError(edge->getTagStr() + " is not a child element"); - } else { - myChildEdges.erase(it); - } -} - - -template <> void -GNEChildContainer::removeChildElement(GNELane* lane) { - // check lane - auto it = std::find(myChildLanes.begin(), myChildLanes.end(), lane); - if (it == myChildLanes.end()) { - throw ProcessError(lane->getTagStr() + " is not a child element"); - } else { - myChildLanes.erase(it); - } -} - - -template <> void -GNEChildContainer::removeChildElement(GNEAdditional* additional) { - // check additional - auto it = std::find(myChildAdditionals.begin(), myChildAdditionals.end(), additional); - if (it == myChildAdditionals.end()) { - throw ProcessError(additional->getTagStr() + " is not a child element"); - } else { - myChildAdditionals.erase(it); - } -} - - -template <> void -GNEChildContainer::removeChildElement(GNEDemandElement* demandElement) { - // check demand element - auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); - if (it == myChildDemandElements.end()) { - throw ProcessError(demandElement->getTagStr() + " is not a child element"); - } else { - myChildDemandElements.erase(it); - } -} - - -template <> void -GNEChildContainer::removeChildElement(GNEGenericData* genericData) { - // check generic data - auto it = std::find(myChildGenericDatas.begin(), myChildGenericDatas.end(), genericData); - if (it == myChildGenericDatas.end()) { - throw ProcessError(genericData->getTagStr() + " is not a child element"); - } else { - myChildGenericDatas.erase(it); - } -} - - -template<> const std::vector& -GNEChildContainer::getParents() const { - return myParentJunctions; -} - - -template<> const std::vector& -GNEChildContainer::getParents() const { - return myParentEdges; -} - - -template<> const std::vector& -GNEChildContainer::getParents() const { - return myParentLanes; -} - - -template<> const std::vector& -GNEChildContainer::getParents() const { - return myParentAdditionals; -} - - -template<> const std::vector& -GNEChildContainer::getParents() const { - return myParentDemandElements; -} - - -template<> const std::vector& -GNEChildContainer::getParents() const { - return myParentGenericDatas; -} - - -template<> void -GNEChildContainer::setParents(const std::vector& newParents) { - myParentJunctions = newParents; -} - - -template<> void -GNEChildContainer::setParents(const std::vector& newParents) { - myParentEdges = newParents; -} - - -template<> void -GNEChildContainer::setParents(const std::vector& newParents) { - myParentLanes = newParents; -} - - -template<> void -GNEChildContainer::setParents(const std::vector& newParents) { - myParentAdditionals = newParents; -} - - -template<> void -GNEChildContainer::setParents(const std::vector& newParents) { - myParentDemandElements = newParents; -} - - -template<> void -GNEChildContainer::setParents(const std::vector& newParents) { - myParentGenericDatas = newParents; -} - - -template<> const std::vector& -GNEChildContainer::getChildren() const { - return myChildJunctions; -} - - -template<> const std::vector& -GNEChildContainer::getChildren() const { - return myChildEdges; -} - - -template<> const std::vector& -GNEChildContainer::getChildren() const { - return myChildLanes; -} - - -template<> const std::vector& -GNEChildContainer::getChildren() const { - return myChildAdditionals; -} - - -template<> const std::vector& -GNEChildContainer::getChildren() const { - return myChildDemandElements; -} - - -template<> const std::vector& -GNEChildContainer::getChildren() const { - return myChildGenericDatas; -} - - -template<> void -GNEChildContainer::setChildren(const std::vector& newChildren) { - myChildJunctions = newChildren; -} - - -template<> void -GNEChildContainer::setChildren(const std::vector& newChildren) { - myChildEdges = newChildren; -} - - -template<> void -GNEChildContainer::setChildren(const std::vector& newChildren) { - myChildLanes = newChildren; -} - - -template<> void -GNEChildContainer::setChildren(const std::vector& newChildren) { - myChildAdditionals = newChildren; -} - - -template<> void -GNEChildContainer::setChildren(const std::vector& newChildren) { - myChildDemandElements = newChildren; -} - - -template<> void -GNEChildContainer::setChildren(const std::vector& newChildren) { - myChildGenericDatas = newChildren; -} - -/****************************************************************************/ diff --git a/src/netedit/elements/GNEChildContainer.h b/src/netedit/elements/GNEChildContainer.h index afa3f4917ddc..c15911a7fbeb 100644 --- a/src/netedit/elements/GNEChildContainer.h +++ b/src/netedit/elements/GNEChildContainer.h @@ -39,91 +39,27 @@ class GNEHierarchicalElement; // class definitions // =========================================================================== -/// @brief Hierarchical container (used for keep myParent and myChildren +/// @brief child container (used for keep children either as vector or as hash) +template class GNEChildContainer { public: /// @brief default constructor - GNEChildContainer(); + GNEChildContainer() {} - /// @brief parameter constructor (only for parents) - GNEChildContainer( - const std::vector& parentJunctions, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentAdditionals, - const std::vector& ParentDemandElements, - const std::vector& parentGenericDatas); + /// @brief parameter constructor + GNEChildContainer(const std::vector& elements) {} /// @brief get container size - size_t getContainerSize() const; + size_t size() const {} /// @brief add parent element - template - void addParentElement(T* element); + void insertElement(T* element) {} /// @brief remove parent element - template - void removeParentElement(T* element); - - /// @brief add child element - template - void addChildElement(T* element); - - /// @brief remove child element - template - void removeChildElement(T* element); - - /// @brief get parents - template - const T& getParents() const; - - /// @brief set parents - template - void setParents(const T& newParents); - - /// @brief get children - template - const T& getChildren() const; - - /// @brief set children - template - void setChildren(const T& newChildren); + void removeElement(T* element) {} private: - /// @brief vector of parent junctions - std::vector myParentJunctions; - - /// @brief vector of parent edges - std::vector myParentEdges; - - /// @brief vector of parent lanes - std::vector myParentLanes; - - /// @brief vector of parent additionals - std::vector myParentAdditionals; - - /// @brief vector of parent demand elements - std::vector myParentDemandElements; - - /// @brief vector of parent generic datas - std::vector myParentGenericDatas; - - /// @brief vector with the child junctions - std::vector myChildJunctions; - - /// @brief vector with the child edges - std::vector myChildEdges; - - /// @brief vector with the child lanes - std::vector myChildLanes; - - /// @brief vector with the child additional - std::vector myChildAdditionals; - - /// @brief vector with the child demand elements - std::vector myChildDemandElements; - - /// @brief vector with the generic child data elements - std::vector myChildGenericDatas; + /// @brief elements vector + std::vector myElements; }; From 102b79990625560328ee7356605762bca3a8fecd Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 09:09:03 +0100 Subject: [PATCH 036/116] Renamed GNEHierarchicalContainer to GNEHierarchicalStructure (.h and .cpp). Refs #16039 --- src/netedit/elements/CMakeLists.txt | 4 ++-- ...HierarchicalContainer.cpp => GNEHierarchicalStructure.cpp} | 2 +- ...{GNEHierarchicalContainer.h => GNEHierarchicalStructure.h} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename src/netedit/elements/{GNEHierarchicalContainer.cpp => GNEHierarchicalStructure.cpp} (99%) rename src/netedit/elements/{GNEHierarchicalContainer.h => GNEHierarchicalStructure.h} (100%) diff --git a/src/netedit/elements/CMakeLists.txt b/src/netedit/elements/CMakeLists.txt index c5fda76092d0..2c98b473f849 100644 --- a/src/netedit/elements/CMakeLists.txt +++ b/src/netedit/elements/CMakeLists.txt @@ -14,8 +14,8 @@ set(netedit_elements_SRCS GNEContour.h GNEGeneralHandler.cpp GNEGeneralHandler.h - GNEHierarchicalContainer.cpp - GNEHierarchicalContainer.h + GNEHierarchicalStructure.cpp + GNEHierarchicalStructure.h GNEChildContainer.h GNEHierarchicalElement.cpp GNEHierarchicalElement.h diff --git a/src/netedit/elements/GNEHierarchicalContainer.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp similarity index 99% rename from src/netedit/elements/GNEHierarchicalContainer.cpp rename to src/netedit/elements/GNEHierarchicalStructure.cpp index 34f6f08855ed..0325b1bbe2a0 100644 --- a/src/netedit/elements/GNEHierarchicalContainer.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -26,7 +26,7 @@ #include #include -#include "GNEHierarchicalContainer.h" +#include "GNEHierarchicalStructure.h" // =========================================================================== // member method definitions diff --git a/src/netedit/elements/GNEHierarchicalContainer.h b/src/netedit/elements/GNEHierarchicalStructure.h similarity index 100% rename from src/netedit/elements/GNEHierarchicalContainer.h rename to src/netedit/elements/GNEHierarchicalStructure.h From 69178c4443f24968ea46653c32656e4cf59e085b Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 09:18:45 +0100 Subject: [PATCH 037/116] Renamed references from GNEHierarchicalContainer to GNEHierarchicalStructure. Refs #16039 --- src/netedit/changes/GNEChange.h | 6 +- .../elements/GNEHierarchicalElement.cpp | 36 +++--- src/netedit/elements/GNEHierarchicalElement.h | 30 ++--- .../elements/GNEHierarchicalStructure.cpp | 106 +++++++++--------- .../elements/GNEHierarchicalStructure.h | 10 +- 5 files changed, 94 insertions(+), 94 deletions(-) diff --git a/src/netedit/changes/GNEChange.h b/src/netedit/changes/GNEChange.h index f0246b7cd116..dca3aa62b045 100644 --- a/src/netedit/changes/GNEChange.h +++ b/src/netedit/changes/GNEChange.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include @@ -215,10 +215,10 @@ class GNEChange : public FXObject { const bool mySelectedElement; /// @brief Hierarchical container with parent and children - const GNEHierarchicalContainer myOriginalHierarchicalContainer; + const GNEHierarchicalStructure myOriginalHierarchicalContainer; /// @brief map with hierarchical container of all parent and children elements - std::map myHierarchicalContainers; + std::map myHierarchicalContainers; private: // @brief next GNEChange (can be access by GNEChangeGroup and GNEUndoList) diff --git a/src/netedit/elements/GNEHierarchicalElement.cpp b/src/netedit/elements/GNEHierarchicalElement.cpp index 47acb0729892..0905b0549c46 100644 --- a/src/netedit/elements/GNEHierarchicalElement.cpp +++ b/src/netedit/elements/GNEHierarchicalElement.cpp @@ -40,22 +40,22 @@ GNEHierarchicalElement::GNEHierarchicalElement(GNENet* net, SumoXMLTag tag, const std::vector& ParentDemandElements, const std::vector& parentGenericDatas) : GNEAttributeCarrier(tag, net), - myHierarchicalContainer(parentJunctions, parentEdges, parentLanes, parentAdditionals, ParentDemandElements, parentGenericDatas) { + myHierarchicalStructure(parentJunctions, parentEdges, parentLanes, parentAdditionals, ParentDemandElements, parentGenericDatas) { } GNEHierarchicalElement::~GNEHierarchicalElement() {} -const GNEHierarchicalContainer& +const GNEHierarchicalStructure& GNEHierarchicalElement::getHierarchicalContainer() const { - return myHierarchicalContainer; + return myHierarchicalStructure; } void -GNEHierarchicalElement::restoreHierarchicalContainer(const GNEHierarchicalContainer& container) { - myHierarchicalContainer = container; +GNEHierarchicalElement::restoreHierarchicalContainer(const GNEHierarchicalStructure& container) { + myHierarchicalStructure = container; } @@ -64,7 +64,7 @@ GNEHierarchicalElement::getAllHierarchicalElements() const { // declare result std::vector result; // reserve - result.reserve(myHierarchicalContainer.getContainerSize()); + result.reserve(myHierarchicalStructure.getContainerSize()); // add parent elements for (const auto& element : getParentJunctions()) { result.push_back(element); @@ -109,25 +109,25 @@ GNEHierarchicalElement::getAllHierarchicalElements() const { const std::vector& GNEHierarchicalElement::getParentJunctions() const { - return myHierarchicalContainer.getParents >(); + return myHierarchicalStructure.getParents >(); } const std::vector& GNEHierarchicalElement::getParentEdges() const { - return myHierarchicalContainer.getParents >(); + return myHierarchicalStructure.getParents >(); } const std::vector& GNEHierarchicalElement::getParentLanes() const { - return myHierarchicalContainer.getParents >(); + return myHierarchicalStructure.getParents >(); } const std::vector& GNEHierarchicalElement::getParentAdditionals() const { - return myHierarchicalContainer.getParents >(); + return myHierarchicalStructure.getParents >(); } @@ -157,49 +157,49 @@ GNEHierarchicalElement::getParentTAZs() const { const std::vector& GNEHierarchicalElement::getParentDemandElements() const { - return myHierarchicalContainer.getParents >(); + return myHierarchicalStructure.getParents >(); } const std::vector& GNEHierarchicalElement::getParentGenericDatas() const { - return myHierarchicalContainer.getParents >(); + return myHierarchicalStructure.getParents >(); } const std::vector& GNEHierarchicalElement::getChildJunctions() const { - return myHierarchicalContainer.getChildren >(); + return myHierarchicalStructure.getChildren >(); } const std::vector& GNEHierarchicalElement::getChildEdges() const { - return myHierarchicalContainer.getChildren >(); + return myHierarchicalStructure.getChildren >(); } const std::vector& GNEHierarchicalElement::getChildLanes() const { - return myHierarchicalContainer.getChildren >(); + return myHierarchicalStructure.getChildren >(); } const std::vector& GNEHierarchicalElement::getChildAdditionals() const { - return myHierarchicalContainer.getChildren >(); + return myHierarchicalStructure.getChildren >(); } const std::vector& GNEHierarchicalElement::getChildDemandElements() const { - return myHierarchicalContainer.getChildren >(); + return myHierarchicalStructure.getChildren >(); } const std::vector& GNEHierarchicalElement::getChildGenericDatas() const { - return myHierarchicalContainer.getChildren >(); + return myHierarchicalStructure.getChildren >(); } diff --git a/src/netedit/elements/GNEHierarchicalElement.h b/src/netedit/elements/GNEHierarchicalElement.h index ccfd58f5b45c..0497c2d45b23 100644 --- a/src/netedit/elements/GNEHierarchicalElement.h +++ b/src/netedit/elements/GNEHierarchicalElement.h @@ -23,7 +23,7 @@ #include #include -#include "GNEHierarchicalContainer.h" +#include "GNEHierarchicalStructure.h" // =========================================================================== @@ -77,10 +77,10 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { /// @} /// @brief get hierarchicalcontainer with parents and children - const GNEHierarchicalContainer& getHierarchicalContainer() const; + const GNEHierarchicalStructure& getHierarchicalContainer() const; /// @brief restore hierarchical container - void restoreHierarchicalContainer(const GNEHierarchicalContainer& container); + void restoreHierarchicalContainer(const GNEHierarchicalStructure& container); /// @name common get functions /// @{ @@ -137,25 +137,25 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { /// @brief add parent element template void addParentElement(T* element) { - myHierarchicalContainer.addParentElement(element); + myHierarchicalStructure.addParentElement(element); } /// @brief remove parent element template void removeParentElement(T* element) { - myHierarchicalContainer.removeParentElement(element); + myHierarchicalStructure.removeParentElement(element); } /// @brief add child element template void addChildElement(T* element) { - myHierarchicalContainer.addChildElement(element); + myHierarchicalStructure.addChildElement(element); } /// @brief remove child element template void removeChildElement(T* element) { - myHierarchicalContainer.removeChildElement(element); + myHierarchicalStructure.removeChildElement(element); } /// @} @@ -179,13 +179,13 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { template void replaceParentElements(T* elementChild, const U& newParents) { // remove elementChild from parents - for (const auto& parent : myHierarchicalContainer.getParents()) { + for (const auto& parent : myHierarchicalStructure.getParents()) { parent->removeChildElement(elementChild); } // set new parents junctions - myHierarchicalContainer.setParents(newParents); + myHierarchicalStructure.setParents(newParents); // add elementChild into new parents - for (const auto& parent : myHierarchicalContainer.getParents()) { + for (const auto& parent : myHierarchicalStructure.getParents()) { parent->addChildElement(elementChild); } } @@ -194,20 +194,20 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { template void replaceChildElements(T* elementChild, const U& newChildren) { // remove elementChild from childs - for (const auto& child : myHierarchicalContainer.getChildren()) { + for (const auto& child : myHierarchicalStructure.getChildren()) { child->removeChildElement(elementChild); } // set new childs junctions - myHierarchicalContainer.setChildren(newChildren); + myHierarchicalStructure.setChildren(newChildren); // add elementChild into new childs - for (const auto& child : myHierarchicalContainer.getChildren()) { + for (const auto& child : myHierarchicalStructure.getChildren()) { child->addChildElement(elementChild); } } private: - /// @brief hierarchical container with parents and children - GNEHierarchicalContainer myHierarchicalContainer; + /// @brief hierarchical structure with parents and children + GNEHierarchicalStructure myHierarchicalStructure; /// @brief Invalidated copy constructor. GNEHierarchicalElement(const GNEHierarchicalElement&) = delete; diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index 0325b1bbe2a0..631ce10fb694 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -11,11 +11,11 @@ // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later /****************************************************************************/ -/// @file GNEHierarchicalContainer.cpp +/// @file GNEHierarchicalStructure.cpp /// @author Pablo Alvarez Lopez /// @date Jul 2020 /// -// Container for GNEHierarchicalElements +// Structure for GNEHierarchicalElements /****************************************************************************/ #include @@ -32,10 +32,10 @@ // member method definitions // =========================================================================== -GNEHierarchicalContainer::GNEHierarchicalContainer() {} +GNEHierarchicalStructure::GNEHierarchicalStructure() {} -GNEHierarchicalContainer::GNEHierarchicalContainer( +GNEHierarchicalStructure::GNEHierarchicalStructure( const std::vector& parentJunctions, const std::vector& parentEdges, const std::vector& parentLanes, @@ -52,7 +52,7 @@ GNEHierarchicalContainer::GNEHierarchicalContainer( size_t -GNEHierarchicalContainer::getContainerSize() const { +GNEHierarchicalStructure::getContainerSize() const { return ( myParentJunctions.size() + myParentEdges.size() + @@ -71,43 +71,43 @@ GNEHierarchicalContainer::getContainerSize() const { template <> void -GNEHierarchicalContainer::addParentElement(GNEJunction* junction) { +GNEHierarchicalStructure::addParentElement(GNEJunction* junction) { myParentJunctions.push_back(junction); } template <> void -GNEHierarchicalContainer::addParentElement(GNEEdge* edge) { +GNEHierarchicalStructure::addParentElement(GNEEdge* edge) { myParentEdges.push_back(edge); } template <> void -GNEHierarchicalContainer::addParentElement(GNELane* lane) { +GNEHierarchicalStructure::addParentElement(GNELane* lane) { myParentLanes.push_back(lane); } template <> void -GNEHierarchicalContainer::addParentElement(GNEAdditional* additional) { +GNEHierarchicalStructure::addParentElement(GNEAdditional* additional) { myParentAdditionals.push_back(additional); } template <> void -GNEHierarchicalContainer::addParentElement(GNEDemandElement* demandElement) { +GNEHierarchicalStructure::addParentElement(GNEDemandElement* demandElement) { myParentDemandElements.push_back(demandElement); } template <> void -GNEHierarchicalContainer::addParentElement(GNEGenericData* genericData) { +GNEHierarchicalStructure::addParentElement(GNEGenericData* genericData) { myParentGenericDatas.push_back(genericData); } template <> void -GNEHierarchicalContainer::removeParentElement(GNEJunction* junction) { +GNEHierarchicalStructure::removeParentElement(GNEJunction* junction) { // check junction auto it = std::find(myParentJunctions.begin(), myParentJunctions.end(), junction); if (it == myParentJunctions.end()) { @@ -119,7 +119,7 @@ GNEHierarchicalContainer::removeParentElement(GNEJunction* junction) { template <> void -GNEHierarchicalContainer::removeParentElement(GNEEdge* edge) { +GNEHierarchicalStructure::removeParentElement(GNEEdge* edge) { // check edge auto it = std::find(myParentEdges.begin(), myParentEdges.end(), edge); if (it == myParentEdges.end()) { @@ -131,7 +131,7 @@ GNEHierarchicalContainer::removeParentElement(GNEEdge* edge) { template <> void -GNEHierarchicalContainer::removeParentElement(GNELane* lane) { +GNEHierarchicalStructure::removeParentElement(GNELane* lane) { // check lane auto it = std::find(myParentLanes.begin(), myParentLanes.end(), lane); if (it == myParentLanes.end()) { @@ -143,7 +143,7 @@ GNEHierarchicalContainer::removeParentElement(GNELane* lane) { template <> void -GNEHierarchicalContainer::removeParentElement(GNEAdditional* additional) { +GNEHierarchicalStructure::removeParentElement(GNEAdditional* additional) { // check additional auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional); if (it == myParentAdditionals.end()) { @@ -155,7 +155,7 @@ GNEHierarchicalContainer::removeParentElement(GNEAdditional* additional) { template <> void -GNEHierarchicalContainer::removeParentElement(GNEDemandElement* demandElement) { +GNEHierarchicalStructure::removeParentElement(GNEDemandElement* demandElement) { // check TAZElement auto it = std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement); if (it == myParentDemandElements.end()) { @@ -167,7 +167,7 @@ GNEHierarchicalContainer::removeParentElement(GNEDemandElement* demandElement) { template <> void -GNEHierarchicalContainer::removeParentElement(GNEGenericData* genericData) { +GNEHierarchicalStructure::removeParentElement(GNEGenericData* genericData) { // check generic data auto it = std::find(myParentGenericDatas.begin(), myParentGenericDatas.end(), genericData); if (it == myParentGenericDatas.end()) { @@ -179,44 +179,44 @@ GNEHierarchicalContainer::removeParentElement(GNEGenericData* genericData) { template <> void -GNEHierarchicalContainer::addChildElement(GNEJunction* junction) { +GNEHierarchicalStructure::addChildElement(GNEJunction* junction) { myChildJunctions.push_back(junction); } template <> void -GNEHierarchicalContainer::addChildElement(GNEEdge* edge) { +GNEHierarchicalStructure::addChildElement(GNEEdge* edge) { myChildEdges.push_back(edge); } template <> void -GNEHierarchicalContainer::addChildElement(GNELane* lane) { +GNEHierarchicalStructure::addChildElement(GNELane* lane) { myChildLanes.push_back(lane); } template <> void -GNEHierarchicalContainer::addChildElement(GNEAdditional* additional) { +GNEHierarchicalStructure::addChildElement(GNEAdditional* additional) { myChildAdditionals.push_back(additional); } template <> void -GNEHierarchicalContainer::addChildElement(GNEDemandElement* demandElement) { +GNEHierarchicalStructure::addChildElement(GNEDemandElement* demandElement) { myChildDemandElements.push_back(demandElement); } template <> void -GNEHierarchicalContainer::addChildElement(GNEGenericData* genericData) { +GNEHierarchicalStructure::addChildElement(GNEGenericData* genericData) { myChildGenericDatas.push_back(genericData); } template <> void -GNEHierarchicalContainer::removeChildElement(GNEJunction* junction) { +GNEHierarchicalStructure::removeChildElement(GNEJunction* junction) { // check junction auto it = std::find(myChildJunctions.begin(), myChildJunctions.end(), junction); if (it == myChildJunctions.end()) { @@ -228,7 +228,7 @@ GNEHierarchicalContainer::removeChildElement(GNEJunction* junction) { template <> void -GNEHierarchicalContainer::removeChildElement(GNEEdge* edge) { +GNEHierarchicalStructure::removeChildElement(GNEEdge* edge) { // check edge auto it = std::find(myChildEdges.begin(), myChildEdges.end(), edge); if (it == myChildEdges.end()) { @@ -240,7 +240,7 @@ GNEHierarchicalContainer::removeChildElement(GNEEdge* edge) { template <> void -GNEHierarchicalContainer::removeChildElement(GNELane* lane) { +GNEHierarchicalStructure::removeChildElement(GNELane* lane) { // check lane auto it = std::find(myChildLanes.begin(), myChildLanes.end(), lane); if (it == myChildLanes.end()) { @@ -252,7 +252,7 @@ GNEHierarchicalContainer::removeChildElement(GNELane* lane) { template <> void -GNEHierarchicalContainer::removeChildElement(GNEAdditional* additional) { +GNEHierarchicalStructure::removeChildElement(GNEAdditional* additional) { // check additional auto it = std::find(myChildAdditionals.begin(), myChildAdditionals.end(), additional); if (it == myChildAdditionals.end()) { @@ -264,7 +264,7 @@ GNEHierarchicalContainer::removeChildElement(GNEAdditional* additional) { template <> void -GNEHierarchicalContainer::removeChildElement(GNEDemandElement* demandElement) { +GNEHierarchicalStructure::removeChildElement(GNEDemandElement* demandElement) { // check demand element auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); if (it == myChildDemandElements.end()) { @@ -276,7 +276,7 @@ GNEHierarchicalContainer::removeChildElement(GNEDemandElement* demandElement) { template <> void -GNEHierarchicalContainer::removeChildElement(GNEGenericData* genericData) { +GNEHierarchicalStructure::removeChildElement(GNEGenericData* genericData) { // check generic data auto it = std::find(myChildGenericDatas.begin(), myChildGenericDatas.end(), genericData); if (it == myChildGenericDatas.end()) { @@ -288,145 +288,145 @@ GNEHierarchicalContainer::removeChildElement(GNEGenericData* genericData) { template<> const std::vector& -GNEHierarchicalContainer::getParents() const { +GNEHierarchicalStructure::getParents() const { return myParentJunctions; } template<> const std::vector& -GNEHierarchicalContainer::getParents() const { +GNEHierarchicalStructure::getParents() const { return myParentEdges; } template<> const std::vector& -GNEHierarchicalContainer::getParents() const { +GNEHierarchicalStructure::getParents() const { return myParentLanes; } template<> const std::vector& -GNEHierarchicalContainer::getParents() const { +GNEHierarchicalStructure::getParents() const { return myParentAdditionals; } template<> const std::vector& -GNEHierarchicalContainer::getParents() const { +GNEHierarchicalStructure::getParents() const { return myParentDemandElements; } template<> const std::vector& -GNEHierarchicalContainer::getParents() const { +GNEHierarchicalStructure::getParents() const { return myParentGenericDatas; } template<> void -GNEHierarchicalContainer::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const std::vector& newParents) { myParentJunctions = newParents; } template<> void -GNEHierarchicalContainer::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const std::vector& newParents) { myParentEdges = newParents; } template<> void -GNEHierarchicalContainer::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const std::vector& newParents) { myParentLanes = newParents; } template<> void -GNEHierarchicalContainer::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const std::vector& newParents) { myParentAdditionals = newParents; } template<> void -GNEHierarchicalContainer::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const std::vector& newParents) { myParentDemandElements = newParents; } template<> void -GNEHierarchicalContainer::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const std::vector& newParents) { myParentGenericDatas = newParents; } template<> const std::vector& -GNEHierarchicalContainer::getChildren() const { +GNEHierarchicalStructure::getChildren() const { return myChildJunctions; } template<> const std::vector& -GNEHierarchicalContainer::getChildren() const { +GNEHierarchicalStructure::getChildren() const { return myChildEdges; } template<> const std::vector& -GNEHierarchicalContainer::getChildren() const { +GNEHierarchicalStructure::getChildren() const { return myChildLanes; } template<> const std::vector& -GNEHierarchicalContainer::getChildren() const { +GNEHierarchicalStructure::getChildren() const { return myChildAdditionals; } template<> const std::vector& -GNEHierarchicalContainer::getChildren() const { +GNEHierarchicalStructure::getChildren() const { return myChildDemandElements; } template<> const std::vector& -GNEHierarchicalContainer::getChildren() const { +GNEHierarchicalStructure::getChildren() const { return myChildGenericDatas; } template<> void -GNEHierarchicalContainer::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { myChildJunctions = newChildren; } template<> void -GNEHierarchicalContainer::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { myChildEdges = newChildren; } template<> void -GNEHierarchicalContainer::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { myChildLanes = newChildren; } template<> void -GNEHierarchicalContainer::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { myChildAdditionals = newChildren; } template<> void -GNEHierarchicalContainer::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { myChildDemandElements = newChildren; } template<> void -GNEHierarchicalContainer::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { myChildGenericDatas = newChildren; } diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index ba383160ec77..3a3858b3dd59 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -11,11 +11,11 @@ // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later /****************************************************************************/ -/// @file GNEHierarchicalContainer.h +/// @file GNEHierarchicalStructure.h /// @author Pablo Alvarez Lopez /// @date Jul 2020 /// -// Container for GNEHierarchicalElements +// Structure for GNEHierarchicalElements /****************************************************************************/ #pragma once #include @@ -40,14 +40,14 @@ class GNEHierarchicalElement; // =========================================================================== /// @brief Hierarchical container (used for keep myParent and myChildren -class GNEHierarchicalContainer { +class GNEHierarchicalStructure { public: /// @brief default constructor - GNEHierarchicalContainer(); + GNEHierarchicalStructure(); /// @brief parameter constructor (only for parents) - GNEHierarchicalContainer( + GNEHierarchicalStructure( const std::vector& parentJunctions, const std::vector& parentEdges, const std::vector& parentLanes, From e2e2bddd8c67e0d551d5f19924ca9adf0ef50879 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 09:20:48 +0100 Subject: [PATCH 038/116] Renamed GNEChildContainer to GNEHierarchicalContainer. Refs #16039 --- src/netedit/elements/CMakeLists.txt | 6 +++--- ...GNEChildContainer.h => GNEHierarchicalContainer.h} | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) rename src/netedit/elements/{GNEChildContainer.h => GNEHierarchicalContainer.h} (87%) diff --git a/src/netedit/elements/CMakeLists.txt b/src/netedit/elements/CMakeLists.txt index 2c98b473f849..1a93aa8c323d 100644 --- a/src/netedit/elements/CMakeLists.txt +++ b/src/netedit/elements/CMakeLists.txt @@ -14,11 +14,11 @@ set(netedit_elements_SRCS GNEContour.h GNEGeneralHandler.cpp GNEGeneralHandler.h - GNEHierarchicalStructure.cpp - GNEHierarchicalStructure.h - GNEChildContainer.h + GNEHierarchicalContainer.h GNEHierarchicalElement.cpp GNEHierarchicalElement.h + GNEHierarchicalStructure.cpp + GNEHierarchicalStructure.h GNEPathElement.cpp GNEPathElement.h GNETagProperties.cpp diff --git a/src/netedit/elements/GNEChildContainer.h b/src/netedit/elements/GNEHierarchicalContainer.h similarity index 87% rename from src/netedit/elements/GNEChildContainer.h rename to src/netedit/elements/GNEHierarchicalContainer.h index c15911a7fbeb..9f5ad3ec25c9 100644 --- a/src/netedit/elements/GNEChildContainer.h +++ b/src/netedit/elements/GNEHierarchicalContainer.h @@ -11,11 +11,11 @@ // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later /****************************************************************************/ -/// @file GNEChildContainer.h +/// @file GNEHierarchicalContainer.h /// @author Pablo Alvarez Lopez /// @date Jan 2025 /// -// Container for GNEHierarchical child elements +// Template container for GNEHierarchical elements /****************************************************************************/ #pragma once #include @@ -39,16 +39,15 @@ class GNEHierarchicalElement; // class definitions // =========================================================================== -/// @brief child container (used for keep children either as vector or as hash) template -class GNEChildContainer { +class GNEHierarchicalContainer { public: /// @brief default constructor - GNEChildContainer() {} + GNEHierarchicalContainer() {} /// @brief parameter constructor - GNEChildContainer(const std::vector& elements) {} + GNEHierarchicalContainer(const std::vector& elements) {} /// @brief get container size size_t size() const {} From 560398a8ef1d9e439c9370eb94fb6a1ae6ae9738 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 10:56:02 +0100 Subject: [PATCH 039/116] Now GNEHierarchicalStructure uses GNEHierarchicalContainer. Refs #16039 --- src/netedit/changes/GNEChange.h | 48 +++--- .../changes/GNEChange_DemandElement.cpp | 4 +- .../elements/GNEHierarchicalContainer.h | 49 +++++- .../elements/GNEHierarchicalElement.cpp | 56 +++---- src/netedit/elements/GNEHierarchicalElement.h | 40 ++--- .../elements/GNEHierarchicalStructure.cpp | 158 ++++++------------ .../elements/GNEHierarchicalStructure.h | 52 +++--- 7 files changed, 199 insertions(+), 208 deletions(-) diff --git a/src/netedit/changes/GNEChange.h b/src/netedit/changes/GNEChange.h index dca3aa62b045..4d7d60c5fb7f 100644 --- a/src/netedit/changes/GNEChange.h +++ b/src/netedit/changes/GNEChange.h @@ -123,41 +123,41 @@ class GNEChange : public FXObject { template void addElementInParentsAndChildren(T* element) { // add element in parents - for (const auto& junction : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& junction : myOriginalHierarchicalContainer.getParents >()) { junction->addChildElement(element); } - for (const auto& edge : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& edge : myOriginalHierarchicalContainer.getParents >()) { edge->addChildElement(element); } - for (const auto& lane : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& lane : myOriginalHierarchicalContainer.getParents >()) { lane->addChildElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& additional : myOriginalHierarchicalContainer.getParents >()) { additional->addChildElement(element); } - for (const auto& demandElement : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& demandElement : myOriginalHierarchicalContainer.getParents >()) { demandElement->addChildElement(element); } - for (const auto& genericData : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& genericData : myOriginalHierarchicalContainer.getParents >()) { genericData->addChildElement(element); } // add element in children - for (const auto& junction : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& junction : myOriginalHierarchicalContainer.getChildren >()) { junction->addParentElement(element); } - for (const auto& edge : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& edge : myOriginalHierarchicalContainer.getChildren >()) { edge->addParentElement(element); } - for (const auto& lane : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& lane : myOriginalHierarchicalContainer.getChildren >()) { lane->addParentElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& additional : myOriginalHierarchicalContainer.getChildren >()) { additional->addParentElement(element); } - for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren >()) { demandElement->addParentElement(element); } - for (const auto& genericData : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& genericData : myOriginalHierarchicalContainer.getChildren >()) { genericData->addParentElement(element); } } @@ -166,41 +166,41 @@ class GNEChange : public FXObject { template void removeElementFromParentsAndChildren(T* element) { // Remove element from parents - for (const auto& junction : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& junction : myOriginalHierarchicalContainer.getParents >()) { junction->removeChildElement(element); } - for (const auto& edge : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& edge : myOriginalHierarchicalContainer.getParents >()) { edge->removeChildElement(element); } - for (const auto& lane : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& lane : myOriginalHierarchicalContainer.getParents >()) { lane->removeChildElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& additional : myOriginalHierarchicalContainer.getParents >()) { additional->removeChildElement(element); } - for (const auto& demandElement : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& demandElement : myOriginalHierarchicalContainer.getParents >()) { demandElement->removeChildElement(element); } - for (const auto& genericData : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& genericData : myOriginalHierarchicalContainer.getParents >()) { genericData->removeChildElement(element); } // Remove element from children - for (const auto& junction : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& junction : myOriginalHierarchicalContainer.getChildren >()) { junction->removeParentElement(element); } - for (const auto& edge : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& edge : myOriginalHierarchicalContainer.getChildren >()) { edge->removeParentElement(element); } - for (const auto& lane : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& lane : myOriginalHierarchicalContainer.getChildren >()) { lane->removeParentElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& additional : myOriginalHierarchicalContainer.getChildren >()) { additional->removeParentElement(element); } - for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren >()) { demandElement->removeParentElement(element); } - for (const auto& genericData : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& genericData : myOriginalHierarchicalContainer.getChildren >()) { genericData->removeParentElement(element); } } diff --git a/src/netedit/changes/GNEChange_DemandElement.cpp b/src/netedit/changes/GNEChange_DemandElement.cpp index 1421f6490906..54f8f6335d01 100644 --- a/src/netedit/changes/GNEChange_DemandElement.cpp +++ b/src/netedit/changes/GNEChange_DemandElement.cpp @@ -91,7 +91,7 @@ GNEChange_DemandElement::undo() { myDemandElement->getNet()->getViewNet()->getViewParent()->getTypeFrame()->getTypeSelector()->refreshTypeSelector(true); } // update stack labels - const auto parentEdges = myOriginalHierarchicalContainer.getParents >(); + const auto parentEdges = myOriginalHierarchicalContainer.getParents >(); if (parentEdges.size() > 0) { parentEdges.front()->updateVehicleStackLabels(); parentEdges.front()->updatePersonStackLabels(); @@ -132,7 +132,7 @@ GNEChange_DemandElement::redo() { myDemandElement->getNet()->getViewNet()->getViewParent()->getTypeFrame()->getTypeSelector()->refreshTypeSelector(true); } // update stack labels - const auto parentEdges = myOriginalHierarchicalContainer.getParents >(); + const auto parentEdges = myOriginalHierarchicalContainer.getParents >(); if (parentEdges.size() > 0) { parentEdges.front()->updateVehicleStackLabels(); parentEdges.front()->updatePersonStackLabels(); diff --git a/src/netedit/elements/GNEHierarchicalContainer.h b/src/netedit/elements/GNEHierarchicalContainer.h index 9f5ad3ec25c9..ef1b501245ef 100644 --- a/src/netedit/elements/GNEHierarchicalContainer.h +++ b/src/netedit/elements/GNEHierarchicalContainer.h @@ -22,6 +22,9 @@ #include + +#define MAX_HIERARCHICAL_PARENTS 10 + // =========================================================================== // class declarations // =========================================================================== @@ -39,26 +42,60 @@ class GNEHierarchicalElement; // class definitions // =========================================================================== +/// @brief container type +enum class HierarchicalContainerType { + BASIC +}; + template -class GNEHierarchicalContainer { +class GNEHierarchicalContainer : public std::vector { public: /// @brief default constructor GNEHierarchicalContainer() {} /// @brief parameter constructor - GNEHierarchicalContainer(const std::vector& elements) {} + GNEHierarchicalContainer(const std::vector& elements, HierarchicalContainerType type): + myType(type) { + if (myType == HierarchicalContainerType::BASIC) { + myVectorElements.reserve(MAX_HIERARCHICAL_PARENTS); + } + } /// @brief get container size - size_t size() const {} + size_t size() const { + return myVectorElements.size(); + } /// @brief add parent element - void insertElement(T* element) {} + void insert(T element) { + myVectorElements.push_back(element); + } /// @brief remove parent element - void removeElement(T* element) {} + bool erase(T element) { + auto it = std::find(myVectorElements.begin(), myVectorElements.end(), element); + if (it != myVectorElements.end()) { + myVectorElements.erase(it); + return true; + } else { + return false; + } + } + + /// @brief update all elements + void set(const std::vector& elements) { + myVectorElements.clear(); + myVectorElements.reserve(elements.size()); + for (const auto &element : elements) { + myVectorElements.push_back(element); + } + } private: + /// @brief container type + HierarchicalContainerType myType; + /// @brief elements vector - std::vector myElements; + std::vector myVectorElements; }; diff --git a/src/netedit/elements/GNEHierarchicalElement.cpp b/src/netedit/elements/GNEHierarchicalElement.cpp index 0905b0549c46..b84b967382d5 100644 --- a/src/netedit/elements/GNEHierarchicalElement.cpp +++ b/src/netedit/elements/GNEHierarchicalElement.cpp @@ -107,33 +107,33 @@ GNEHierarchicalElement::getAllHierarchicalElements() const { } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getParentJunctions() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents >(); } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getParentEdges() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents >(); } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getParentLanes() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents >(); } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getParentAdditionals() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents >(); } -const std::vector +const GNEHierarchicalContainer GNEHierarchicalElement::getParentStoppingPlaces() const { - std::vector stoppingPlaces; + GNEHierarchicalContainer stoppingPlaces; for (const auto& additional : getParentAdditionals()) { if (additional->getTagProperty().isStoppingPlace()) { stoppingPlaces.push_back(additional); @@ -143,9 +143,9 @@ GNEHierarchicalElement::getParentStoppingPlaces() const { } -const std::vector +const GNEHierarchicalContainer GNEHierarchicalElement::getParentTAZs() const { - std::vector TAZs; + GNEHierarchicalContainer TAZs; for (const auto& additional : getParentAdditionals()) { if (additional->getTagProperty().isTAZElement()) { TAZs.push_back(additional); @@ -155,51 +155,51 @@ GNEHierarchicalElement::getParentTAZs() const { } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getParentDemandElements() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents >(); } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getParentGenericDatas() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents >(); } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getChildJunctions() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren >(); } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getChildEdges() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren >(); } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getChildLanes() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren >(); } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getChildAdditionals() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren >(); } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getChildDemandElements() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren >(); } -const std::vector& +const GNEHierarchicalContainer& GNEHierarchicalElement::getChildGenericDatas() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren >(); } diff --git a/src/netedit/elements/GNEHierarchicalElement.h b/src/netedit/elements/GNEHierarchicalElement.h index 0497c2d45b23..74159dbc206d 100644 --- a/src/netedit/elements/GNEHierarchicalElement.h +++ b/src/netedit/elements/GNEHierarchicalElement.h @@ -89,46 +89,46 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { std::vector getAllHierarchicalElements() const; /// @brief get parent junctions - const std::vector& getParentJunctions() const; + const GNEHierarchicalContainer& getParentJunctions() const; /// @brief get parent edges - const std::vector& getParentEdges() const; + const GNEHierarchicalContainer& getParentEdges() const; /// @brief get parent lanes - const std::vector& getParentLanes() const; + const GNEHierarchicalContainer& getParentLanes() const; /// @brief get parent additionals - const std::vector& getParentAdditionals() const; + const GNEHierarchicalContainer& getParentAdditionals() const; /// @brief get parent stoppingPlaces (used by plans) - const std::vector getParentStoppingPlaces() const; + const GNEHierarchicalContainer getParentStoppingPlaces() const; /// @brief get parent TAZs (used by plans) - const std::vector getParentTAZs() const; + const GNEHierarchicalContainer getParentTAZs() const; /// @brief get parent demand elements - const std::vector& getParentDemandElements() const; + const GNEHierarchicalContainer& getParentDemandElements() const; /// @brief get parent demand elements - const std::vector& getParentGenericDatas() const; + const GNEHierarchicalContainer& getParentGenericDatas() const; /// @brief get child junctions - const std::vector& getChildJunctions() const; + const GNEHierarchicalContainer& getChildJunctions() const; /// @brief get child edges - const std::vector& getChildEdges() const; + const GNEHierarchicalContainer& getChildEdges() const; /// @brief get child lanes - const std::vector& getChildLanes() const; + const GNEHierarchicalContainer& getChildLanes() const; /// @brief return child additionals - const std::vector& getChildAdditionals() const; + const GNEHierarchicalContainer& getChildAdditionals() const; /// @brief return child demand elements - const std::vector& getChildDemandElements() const; + const GNEHierarchicalContainer& getChildDemandElements() const; /// @brief return child generic data elements - const std::vector& getChildGenericDatas() const; + const GNEHierarchicalContainer& getChildGenericDatas() const; /// @} /// @name common generic add/remove functions @@ -177,30 +177,30 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { protected: /// @brief replace parent elements template - void replaceParentElements(T* elementChild, const U& newParents) { + void replaceParentElements(T* elementChild, const std::vector& newParents) { // remove elementChild from parents - for (const auto& parent : myHierarchicalStructure.getParents()) { + for (const auto& parent : myHierarchicalStructure.getParents< GNEHierarchicalContainer >()) { parent->removeChildElement(elementChild); } // set new parents junctions myHierarchicalStructure.setParents(newParents); // add elementChild into new parents - for (const auto& parent : myHierarchicalStructure.getParents()) { + for (const auto& parent : myHierarchicalStructure.getParents< GNEHierarchicalContainer >()) { parent->addChildElement(elementChild); } } /// @brief replace child elements template - void replaceChildElements(T* elementChild, const U& newChildren) { + void replaceChildElements(T* elementChild, const std::vector& newChildren) { // remove elementChild from childs - for (const auto& child : myHierarchicalStructure.getChildren()) { + for (const auto& child : myHierarchicalStructure.getChildren< GNEHierarchicalContainer >()) { child->removeChildElement(elementChild); } // set new childs junctions myHierarchicalStructure.setChildren(newChildren); // add elementChild into new childs - for (const auto& child : myHierarchicalStructure.getChildren()) { + for (const auto& child : myHierarchicalStructure.getChildren< GNEHierarchicalContainer >()) { child->addChildElement(elementChild); } } diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index 631ce10fb694..0ea7c1705473 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -40,14 +40,14 @@ GNEHierarchicalStructure::GNEHierarchicalStructure( const std::vector& parentEdges, const std::vector& parentLanes, const std::vector& parentAdditionals, - const std::vector& ParentDemandElements, + const std::vector& parentDemandElements, const std::vector& parentGenericDatas): - myParentJunctions(parentJunctions), - myParentEdges(parentEdges), - myParentLanes(parentLanes), - myParentAdditionals(parentAdditionals), - myParentDemandElements(ParentDemandElements), - myParentGenericDatas(parentGenericDatas) { + myParentJunctions(parentJunctions, HierarchicalContainerType::BASIC), + myParentEdges(parentEdges, HierarchicalContainerType::BASIC), + myParentLanes(parentLanes, HierarchicalContainerType::BASIC), + myParentAdditionals(parentAdditionals, HierarchicalContainerType::BASIC), + myParentDemandElements(parentDemandElements, HierarchicalContainerType::BASIC), + myParentGenericDatas(parentGenericDatas, HierarchicalContainerType::BASIC) { } @@ -72,252 +72,204 @@ GNEHierarchicalStructure::getContainerSize() const { template <> void GNEHierarchicalStructure::addParentElement(GNEJunction* junction) { - myParentJunctions.push_back(junction); + myParentJunctions.insert(junction); } template <> void GNEHierarchicalStructure::addParentElement(GNEEdge* edge) { - myParentEdges.push_back(edge); + myParentEdges.insert(edge); } template <> void GNEHierarchicalStructure::addParentElement(GNELane* lane) { - myParentLanes.push_back(lane); + myParentLanes.insert(lane); } template <> void GNEHierarchicalStructure::addParentElement(GNEAdditional* additional) { - myParentAdditionals.push_back(additional); + myParentAdditionals.insert(additional); } template <> void GNEHierarchicalStructure::addParentElement(GNEDemandElement* demandElement) { - myParentDemandElements.push_back(demandElement); + myParentDemandElements.insert(demandElement); } template <> void GNEHierarchicalStructure::addParentElement(GNEGenericData* genericData) { - myParentGenericDatas.push_back(genericData); + myParentGenericDatas.insert(genericData); } template <> void GNEHierarchicalStructure::removeParentElement(GNEJunction* junction) { - // check junction - auto it = std::find(myParentJunctions.begin(), myParentJunctions.end(), junction); - if (it == myParentJunctions.end()) { + if (myParentJunctions.erase(junction) == false) { throw ProcessError(junction->getTagStr() + " with ID='" + junction->getID() + "' is not a parent element"); - } else { - myParentJunctions.erase(it); } } template <> void GNEHierarchicalStructure::removeParentElement(GNEEdge* edge) { - // check edge - auto it = std::find(myParentEdges.begin(), myParentEdges.end(), edge); - if (it == myParentEdges.end()) { + if (myParentEdges.erase(edge) == false) { throw ProcessError(edge->getTagStr() + " with ID='" + edge->getID() + "' is not a parent element"); - } else { - myParentEdges.erase(it); } } template <> void GNEHierarchicalStructure::removeParentElement(GNELane* lane) { - // check lane - auto it = std::find(myParentLanes.begin(), myParentLanes.end(), lane); - if (it == myParentLanes.end()) { + if (myParentLanes.erase(lane) == false) { throw ProcessError(lane->getTagStr() + " with ID='" + lane->getID() + "' is not a parent element"); - } else { - myParentLanes.erase(it); } } template <> void GNEHierarchicalStructure::removeParentElement(GNEAdditional* additional) { - // check additional - auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional); - if (it == myParentAdditionals.end()) { + if (myParentAdditionals.erase(additional) == false) { throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' is not a parent element"); - } else { - myParentAdditionals.erase(it); } } template <> void GNEHierarchicalStructure::removeParentElement(GNEDemandElement* demandElement) { - // check TAZElement - auto it = std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement); - if (it == myParentDemandElements.end()) { + if (myParentDemandElements.erase(demandElement) == false) { throw ProcessError(demandElement->getTagStr() + " is not a parent element"); - } else { - myParentDemandElements.erase(it); } } template <> void GNEHierarchicalStructure::removeParentElement(GNEGenericData* genericData) { - // check generic data - auto it = std::find(myParentGenericDatas.begin(), myParentGenericDatas.end(), genericData); - if (it == myParentGenericDatas.end()) { + if (myParentGenericDatas.erase(genericData) == false) { throw ProcessError(genericData->getTagStr() + " is not a parent element"); - } else { - myParentGenericDatas.erase(it); } } template <> void GNEHierarchicalStructure::addChildElement(GNEJunction* junction) { - myChildJunctions.push_back(junction); + myChildJunctions.insert(junction); } template <> void GNEHierarchicalStructure::addChildElement(GNEEdge* edge) { - myChildEdges.push_back(edge); + myChildEdges.insert(edge); } template <> void GNEHierarchicalStructure::addChildElement(GNELane* lane) { - myChildLanes.push_back(lane); + myChildLanes.insert(lane); } template <> void GNEHierarchicalStructure::addChildElement(GNEAdditional* additional) { - myChildAdditionals.push_back(additional); + myChildAdditionals.insert(additional); } template <> void GNEHierarchicalStructure::addChildElement(GNEDemandElement* demandElement) { - myChildDemandElements.push_back(demandElement); + myChildDemandElements.insert(demandElement); } template <> void GNEHierarchicalStructure::addChildElement(GNEGenericData* genericData) { - myChildGenericDatas.push_back(genericData); + myChildGenericDatas.insert(genericData); } template <> void GNEHierarchicalStructure::removeChildElement(GNEJunction* junction) { - // check junction - auto it = std::find(myChildJunctions.begin(), myChildJunctions.end(), junction); - if (it == myChildJunctions.end()) { + if (myChildJunctions.erase(junction) == false) { throw ProcessError(junction->getTagStr() + " is not a child element"); - } else { - myChildJunctions.erase(it); } } template <> void GNEHierarchicalStructure::removeChildElement(GNEEdge* edge) { - // check edge - auto it = std::find(myChildEdges.begin(), myChildEdges.end(), edge); - if (it == myChildEdges.end()) { + if (myChildEdges.erase(edge) == false) { throw ProcessError(edge->getTagStr() + " is not a child element"); - } else { - myChildEdges.erase(it); } } template <> void GNEHierarchicalStructure::removeChildElement(GNELane* lane) { - // check lane - auto it = std::find(myChildLanes.begin(), myChildLanes.end(), lane); - if (it == myChildLanes.end()) { + if (myChildLanes.erase(lane) == false) { throw ProcessError(lane->getTagStr() + " is not a child element"); - } else { - myChildLanes.erase(it); } } template <> void GNEHierarchicalStructure::removeChildElement(GNEAdditional* additional) { - // check additional - auto it = std::find(myChildAdditionals.begin(), myChildAdditionals.end(), additional); - if (it == myChildAdditionals.end()) { + if (myChildAdditionals.erase(additional) == false) { throw ProcessError(additional->getTagStr() + " is not a child element"); - } else { - myChildAdditionals.erase(it); } } template <> void GNEHierarchicalStructure::removeChildElement(GNEDemandElement* demandElement) { - // check demand element - auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); - if (it == myChildDemandElements.end()) { + if (myChildDemandElements.erase(demandElement) == false) { throw ProcessError(demandElement->getTagStr() + " is not a child element"); - } else { - myChildDemandElements.erase(it); } } template <> void GNEHierarchicalStructure::removeChildElement(GNEGenericData* genericData) { - // check generic data - auto it = std::find(myChildGenericDatas.begin(), myChildGenericDatas.end(), genericData); - if (it == myChildGenericDatas.end()) { + if (myChildGenericDatas.erase(genericData) == false) { throw ProcessError(genericData->getTagStr() + " is not a child element"); - } else { - myChildGenericDatas.erase(it); } } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getParents() const { return myParentJunctions; } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getParents() const { return myParentEdges; } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getParents() const { return myParentLanes; } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getParents() const { return myParentAdditionals; } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getParents() const { return myParentDemandElements; } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getParents() const { return myParentGenericDatas; } @@ -325,71 +277,71 @@ GNEHierarchicalStructure::getParents() const { template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentJunctions = newParents; + myParentJunctions.set(newParents); } template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentEdges = newParents; + myParentEdges.set(newParents); } template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentLanes = newParents; + myParentLanes.set(newParents); } template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentAdditionals = newParents; + myParentAdditionals.set(newParents); } template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentDemandElements = newParents; + myParentDemandElements.set(newParents); } template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentGenericDatas = newParents; + myParentGenericDatas.set(newParents); } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getChildren() const { return myChildJunctions; } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getChildren() const { return myChildEdges; } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getChildren() const { return myChildLanes; } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getChildren() const { return myChildAdditionals; } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getChildren() const { return myChildDemandElements; } -template<> const std::vector& +template<> const GNEHierarchicalContainer& GNEHierarchicalStructure::getChildren() const { return myChildGenericDatas; } @@ -397,37 +349,37 @@ GNEHierarchicalStructure::getChildren() const { template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildJunctions = newChildren; + myChildJunctions.set(newChildren); } template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildEdges = newChildren; + myChildEdges.set(newChildren); } template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildLanes = newChildren; + myChildLanes.set(newChildren); } template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildAdditionals = newChildren; + myChildAdditionals.set(newChildren); } template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildDemandElements = newChildren; + myChildDemandElements.set(newChildren); } template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildGenericDatas = newChildren; + myChildGenericDatas.set(newChildren); } /****************************************************************************/ diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index 3a3858b3dd59..35dcc09b45ff 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -22,6 +22,8 @@ #include +#include "GNEHierarchicalContainer.h" + // =========================================================================== // class declarations // =========================================================================== @@ -52,7 +54,7 @@ class GNEHierarchicalStructure { const std::vector& parentEdges, const std::vector& parentLanes, const std::vector& parentAdditionals, - const std::vector& ParentDemandElements, + const std::vector& parentDemandElements, const std::vector& parentGenericDatas); /// @brief get container size @@ -91,39 +93,39 @@ class GNEHierarchicalStructure { void setChildren(const T& newChildren); private: - /// @brief vector of parent junctions - std::vector myParentJunctions; + /// @brief parents junctions + GNEHierarchicalContainer myParentJunctions; - /// @brief vector of parent edges - std::vector myParentEdges; + /// @brief parents edges + GNEHierarchicalContainer myParentEdges; - /// @brief vector of parent lanes - std::vector myParentLanes; + /// @brief parents lanes + GNEHierarchicalContainer myParentLanes; - /// @brief vector of parent additionals - std::vector myParentAdditionals; + /// @brief parents additionals + GNEHierarchicalContainer myParentAdditionals; - /// @brief vector of parent demand elements - std::vector myParentDemandElements; + /// @brief parents demand elements + GNEHierarchicalContainer myParentDemandElements; - /// @brief vector of parent generic datas - std::vector myParentGenericDatas; + /// @brief parents generic datas + GNEHierarchicalContainer myParentGenericDatas; - /// @brief vector with the child junctions - std::vector myChildJunctions; + /// @brief children junctions + GNEHierarchicalContainer myChildJunctions; - /// @brief vector with the child edges - std::vector myChildEdges; + /// @brief children edges + GNEHierarchicalContainer myChildEdges; - /// @brief vector with the child lanes - std::vector myChildLanes; + /// @brief children lanes + GNEHierarchicalContainer myChildLanes; - /// @brief vector with the child additional - std::vector myChildAdditionals; + /// @brief children additional elements + GNEHierarchicalContainer myChildAdditionals; - /// @brief vector with the child demand elements - std::vector myChildDemandElements; + /// @brief children demand elements + GNEHierarchicalContainer myChildDemandElements; - /// @brief vector with the generic child data elements - std::vector myChildGenericDatas; + /// @brief children genericdata elements + GNEHierarchicalContainer myChildGenericDatas; }; From 15eb3f1f4273c81a2558a5fe7aad1693a0080f94 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 11:06:11 +0100 Subject: [PATCH 040/116] Optimiced getParents() and getChildren(). Refs #16039 --- src/netedit/changes/GNEChange.h | 48 +++++++++---------- .../changes/GNEChange_DemandElement.cpp | 4 +- .../elements/GNEHierarchicalElement.cpp | 24 +++++----- src/netedit/elements/GNEHierarchicalElement.h | 9 ++-- .../elements/GNEHierarchicalStructure.h | 4 +- 5 files changed, 45 insertions(+), 44 deletions(-) diff --git a/src/netedit/changes/GNEChange.h b/src/netedit/changes/GNEChange.h index 4d7d60c5fb7f..8efa36c7b7cb 100644 --- a/src/netedit/changes/GNEChange.h +++ b/src/netedit/changes/GNEChange.h @@ -123,41 +123,41 @@ class GNEChange : public FXObject { template void addElementInParentsAndChildren(T* element) { // add element in parents - for (const auto& junction : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& junction : myOriginalHierarchicalContainer.getParents()) { junction->addChildElement(element); } - for (const auto& edge : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& edge : myOriginalHierarchicalContainer.getParents()) { edge->addChildElement(element); } - for (const auto& lane : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& lane : myOriginalHierarchicalContainer.getParents()) { lane->addChildElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& additional : myOriginalHierarchicalContainer.getParents()) { additional->addChildElement(element); } - for (const auto& demandElement : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& demandElement : myOriginalHierarchicalContainer.getParents()) { demandElement->addChildElement(element); } - for (const auto& genericData : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& genericData : myOriginalHierarchicalContainer.getParents()) { genericData->addChildElement(element); } // add element in children - for (const auto& junction : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& junction : myOriginalHierarchicalContainer.getChildren()) { junction->addParentElement(element); } - for (const auto& edge : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& edge : myOriginalHierarchicalContainer.getChildren()) { edge->addParentElement(element); } - for (const auto& lane : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& lane : myOriginalHierarchicalContainer.getChildren()) { lane->addParentElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& additional : myOriginalHierarchicalContainer.getChildren()) { additional->addParentElement(element); } - for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren()) { demandElement->addParentElement(element); } - for (const auto& genericData : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& genericData : myOriginalHierarchicalContainer.getChildren()) { genericData->addParentElement(element); } } @@ -166,41 +166,41 @@ class GNEChange : public FXObject { template void removeElementFromParentsAndChildren(T* element) { // Remove element from parents - for (const auto& junction : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& junction : myOriginalHierarchicalContainer.getParents()) { junction->removeChildElement(element); } - for (const auto& edge : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& edge : myOriginalHierarchicalContainer.getParents()) { edge->removeChildElement(element); } - for (const auto& lane : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& lane : myOriginalHierarchicalContainer.getParents()) { lane->removeChildElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& additional : myOriginalHierarchicalContainer.getParents()) { additional->removeChildElement(element); } - for (const auto& demandElement : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& demandElement : myOriginalHierarchicalContainer.getParents()) { demandElement->removeChildElement(element); } - for (const auto& genericData : myOriginalHierarchicalContainer.getParents >()) { + for (const auto& genericData : myOriginalHierarchicalContainer.getParents()) { genericData->removeChildElement(element); } // Remove element from children - for (const auto& junction : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& junction : myOriginalHierarchicalContainer.getChildren()) { junction->removeParentElement(element); } - for (const auto& edge : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& edge : myOriginalHierarchicalContainer.getChildren()) { edge->removeParentElement(element); } - for (const auto& lane : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& lane : myOriginalHierarchicalContainer.getChildren()) { lane->removeParentElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& additional : myOriginalHierarchicalContainer.getChildren()) { additional->removeParentElement(element); } - for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren()) { demandElement->removeParentElement(element); } - for (const auto& genericData : myOriginalHierarchicalContainer.getChildren >()) { + for (const auto& genericData : myOriginalHierarchicalContainer.getChildren()) { genericData->removeParentElement(element); } } diff --git a/src/netedit/changes/GNEChange_DemandElement.cpp b/src/netedit/changes/GNEChange_DemandElement.cpp index 54f8f6335d01..a0cae3886429 100644 --- a/src/netedit/changes/GNEChange_DemandElement.cpp +++ b/src/netedit/changes/GNEChange_DemandElement.cpp @@ -91,7 +91,7 @@ GNEChange_DemandElement::undo() { myDemandElement->getNet()->getViewNet()->getViewParent()->getTypeFrame()->getTypeSelector()->refreshTypeSelector(true); } // update stack labels - const auto parentEdges = myOriginalHierarchicalContainer.getParents >(); + const auto parentEdges = myOriginalHierarchicalContainer.getParents(); if (parentEdges.size() > 0) { parentEdges.front()->updateVehicleStackLabels(); parentEdges.front()->updatePersonStackLabels(); @@ -132,7 +132,7 @@ GNEChange_DemandElement::redo() { myDemandElement->getNet()->getViewNet()->getViewParent()->getTypeFrame()->getTypeSelector()->refreshTypeSelector(true); } // update stack labels - const auto parentEdges = myOriginalHierarchicalContainer.getParents >(); + const auto parentEdges = myOriginalHierarchicalContainer.getParents(); if (parentEdges.size() > 0) { parentEdges.front()->updateVehicleStackLabels(); parentEdges.front()->updatePersonStackLabels(); diff --git a/src/netedit/elements/GNEHierarchicalElement.cpp b/src/netedit/elements/GNEHierarchicalElement.cpp index b84b967382d5..7517a8cc8e5c 100644 --- a/src/netedit/elements/GNEHierarchicalElement.cpp +++ b/src/netedit/elements/GNEHierarchicalElement.cpp @@ -109,25 +109,25 @@ GNEHierarchicalElement::getAllHierarchicalElements() const { const GNEHierarchicalContainer& GNEHierarchicalElement::getParentJunctions() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents(); } const GNEHierarchicalContainer& GNEHierarchicalElement::getParentEdges() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents(); } const GNEHierarchicalContainer& GNEHierarchicalElement::getParentLanes() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents(); } const GNEHierarchicalContainer& GNEHierarchicalElement::getParentAdditionals() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents(); } @@ -157,49 +157,49 @@ GNEHierarchicalElement::getParentTAZs() const { const GNEHierarchicalContainer& GNEHierarchicalElement::getParentDemandElements() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents(); } const GNEHierarchicalContainer& GNEHierarchicalElement::getParentGenericDatas() const { - return myHierarchicalStructure.getParents >(); + return myHierarchicalStructure.getParents(); } const GNEHierarchicalContainer& GNEHierarchicalElement::getChildJunctions() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren(); } const GNEHierarchicalContainer& GNEHierarchicalElement::getChildEdges() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren(); } const GNEHierarchicalContainer& GNEHierarchicalElement::getChildLanes() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren(); } const GNEHierarchicalContainer& GNEHierarchicalElement::getChildAdditionals() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren(); } const GNEHierarchicalContainer& GNEHierarchicalElement::getChildDemandElements() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren(); } const GNEHierarchicalContainer& GNEHierarchicalElement::getChildGenericDatas() const { - return myHierarchicalStructure.getChildren >(); + return myHierarchicalStructure.getChildren(); } diff --git a/src/netedit/elements/GNEHierarchicalElement.h b/src/netedit/elements/GNEHierarchicalElement.h index 74159dbc206d..aac0762813ac 100644 --- a/src/netedit/elements/GNEHierarchicalElement.h +++ b/src/netedit/elements/GNEHierarchicalElement.h @@ -129,6 +129,7 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { /// @brief return child generic data elements const GNEHierarchicalContainer& getChildGenericDatas() const; + /// @} /// @name common generic add/remove functions @@ -179,13 +180,13 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { template void replaceParentElements(T* elementChild, const std::vector& newParents) { // remove elementChild from parents - for (const auto& parent : myHierarchicalStructure.getParents< GNEHierarchicalContainer >()) { + for (const auto& parent : myHierarchicalStructure.getParents()) { parent->removeChildElement(elementChild); } // set new parents junctions myHierarchicalStructure.setParents(newParents); // add elementChild into new parents - for (const auto& parent : myHierarchicalStructure.getParents< GNEHierarchicalContainer >()) { + for (const auto& parent : myHierarchicalStructure.getParents()) { parent->addChildElement(elementChild); } } @@ -194,13 +195,13 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { template void replaceChildElements(T* elementChild, const std::vector& newChildren) { // remove elementChild from childs - for (const auto& child : myHierarchicalStructure.getChildren< GNEHierarchicalContainer >()) { + for (const auto& child : myHierarchicalStructure.getChildren()) { child->removeChildElement(elementChild); } // set new childs junctions myHierarchicalStructure.setChildren(newChildren); // add elementChild into new childs - for (const auto& child : myHierarchicalStructure.getChildren< GNEHierarchicalContainer >()) { + for (const auto& child : myHierarchicalStructure.getChildren()) { child->addChildElement(elementChild); } } diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index 35dcc09b45ff..c57948f07a75 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -78,7 +78,7 @@ class GNEHierarchicalStructure { /// @brief get parents template - const T& getParents() const; + const GNEHierarchicalContainer& getParents() const; /// @brief set parents template @@ -86,7 +86,7 @@ class GNEHierarchicalStructure { /// @brief get children template - const T& getChildren() const; + const GNEHierarchicalContainer& getChildren() const; /// @brief set children template From 6f4c9078ca9517d71ff623cde72ba6e2404b0db3 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 11:12:46 +0100 Subject: [PATCH 041/116] Minor refactoring in GNEHierarchicalElement.h. Refs #16039 --- src/netedit/elements/GNEHierarchicalElement.h | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/netedit/elements/GNEHierarchicalElement.h b/src/netedit/elements/GNEHierarchicalElement.h index aac0762813ac..f1f6a759c64e 100644 --- a/src/netedit/elements/GNEHierarchicalElement.h +++ b/src/netedit/elements/GNEHierarchicalElement.h @@ -172,37 +172,37 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { /// @brief check if children are overlapped (Used by Rerouters) bool checkChildAdditionalsOverlapping() const; - /// @brief check if childs demand elements are overlapped + /// @brief check if child demand elements are overlapped bool checkChildDemandElementsOverlapping() const; protected: - /// @brief replace parent elements + /// @brief replace parents in the given edited element template - void replaceParentElements(T* elementChild, const std::vector& newParents) { - // remove elementChild from parents + void replaceParentElements(T* editedElement, const std::vector& newParents) { + // remove edited elements from parents for (const auto& parent : myHierarchicalStructure.getParents()) { - parent->removeChildElement(elementChild); + parent->removeChildElement(editedElement); } - // set new parents junctions + // set new parents myHierarchicalStructure.setParents(newParents); - // add elementChild into new parents + // add edited elements in new parents for (const auto& parent : myHierarchicalStructure.getParents()) { - parent->addChildElement(elementChild); + parent->addChildElement(editedElement); } } - /// @brief replace child elements + /// @brief replace children in the given edited element template - void replaceChildElements(T* elementChild, const std::vector& newChildren) { - // remove elementChild from childs + void replaceChildElements(T* editedElement, const std::vector& newChildren) { + // remove edited elements from children for (const auto& child : myHierarchicalStructure.getChildren()) { - child->removeChildElement(elementChild); + child->removeChildElement(editedElement); } - // set new childs junctions + // set new children myHierarchicalStructure.setChildren(newChildren); - // add elementChild into new childs + // add edited elements in new children for (const auto& child : myHierarchicalStructure.getChildren()) { - child->addChildElement(elementChild); + child->addChildElement(editedElement); } } From d5808628194abd4a5ac24eba2c5cd851b77bf964 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 12:13:03 +0100 Subject: [PATCH 042/116] Spitted GNEHierarchicalContainer in GNEHierarchicalContainerParents and GNEHierarchicalContainerChildren. Refs #16039 --- src/netedit/elements/CMakeLists.txt | 3 +- ...r.h => GNEHierarchicalContainerChildren.h} | 21 +---- .../GNEHierarchicalContainerParents.h | 93 +++++++++++++++++++ .../elements/GNEHierarchicalElement.cpp | 32 +++---- src/netedit/elements/GNEHierarchicalElement.h | 28 +++--- .../elements/GNEHierarchicalStructure.cpp | 36 +++---- .../elements/GNEHierarchicalStructure.h | 31 ++++--- 7 files changed, 164 insertions(+), 80 deletions(-) rename src/netedit/elements/{GNEHierarchicalContainer.h => GNEHierarchicalContainerChildren.h} (83%) create mode 100644 src/netedit/elements/GNEHierarchicalContainerParents.h diff --git a/src/netedit/elements/CMakeLists.txt b/src/netedit/elements/CMakeLists.txt index 1a93aa8c323d..7afbaa6c47c1 100644 --- a/src/netedit/elements/CMakeLists.txt +++ b/src/netedit/elements/CMakeLists.txt @@ -14,7 +14,8 @@ set(netedit_elements_SRCS GNEContour.h GNEGeneralHandler.cpp GNEGeneralHandler.h - GNEHierarchicalContainer.h + GNEHierarchicalContainerParents.h + GNEHierarchicalContainerChildren.h GNEHierarchicalElement.cpp GNEHierarchicalElement.h GNEHierarchicalStructure.cpp diff --git a/src/netedit/elements/GNEHierarchicalContainer.h b/src/netedit/elements/GNEHierarchicalContainerChildren.h similarity index 83% rename from src/netedit/elements/GNEHierarchicalContainer.h rename to src/netedit/elements/GNEHierarchicalContainerChildren.h index ef1b501245ef..68ca0d2b9622 100644 --- a/src/netedit/elements/GNEHierarchicalContainer.h +++ b/src/netedit/elements/GNEHierarchicalContainerChildren.h @@ -11,7 +11,7 @@ // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later /****************************************************************************/ -/// @file GNEHierarchicalContainer.h +/// @file GNEHierarchicalContainerChildren.h /// @author Pablo Alvarez Lopez /// @date Jan 2025 /// @@ -42,24 +42,16 @@ class GNEHierarchicalElement; // class definitions // =========================================================================== -/// @brief container type -enum class HierarchicalContainerType { - BASIC -}; - template -class GNEHierarchicalContainer : public std::vector { +class GNEHierarchicalContainerChildren : public std::vector { public: /// @brief default constructor - GNEHierarchicalContainer() {} + GNEHierarchicalContainerChildren() {} /// @brief parameter constructor - GNEHierarchicalContainer(const std::vector& elements, HierarchicalContainerType type): - myType(type) { - if (myType == HierarchicalContainerType::BASIC) { - myVectorElements.reserve(MAX_HIERARCHICAL_PARENTS); - } + GNEHierarchicalContainerChildren(const std::vector& elements) { + myVectorElements = elements; } /// @brief get container size @@ -93,9 +85,6 @@ class GNEHierarchicalContainer : public std::vector { } private: - /// @brief container type - HierarchicalContainerType myType; - /// @brief elements vector std::vector myVectorElements; }; diff --git a/src/netedit/elements/GNEHierarchicalContainerParents.h b/src/netedit/elements/GNEHierarchicalContainerParents.h new file mode 100644 index 000000000000..48e8670783ff --- /dev/null +++ b/src/netedit/elements/GNEHierarchicalContainerParents.h @@ -0,0 +1,93 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo +// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0/ +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License 2.0 are satisfied: GNU General Public License, version 2 +// or later which is available at +// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later +/****************************************************************************/ +/// @file GNEHierarchicalContainerParents.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2025 +/// +// Template container for GNEHierarchical elements +/****************************************************************************/ +#pragma once +#include + +#include + + +#define MAX_HIERARCHICAL_PARENTS 10 + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNENetworkElement; +class GNEJunction; +class GNEEdge; +class GNELane; +class GNEAdditional; +class GNEDemandElement; +class GNEGenericData; +class GNEHierarchicalElement; + +// =========================================================================== +// class definitions +// =========================================================================== + +template +class GNEHierarchicalContainerParents : public std::vector { + +public: + /// @brief default constructor + GNEHierarchicalContainerParents() { + myVectorElements.reserve(10); + } + + /// @brief parameter constructor + GNEHierarchicalContainerParents(const std::vector& elements) { + myVectorElements.reserve(10); + myVectorElements = elements; + } + + /// @brief get container size + size_t size() const { + return myVectorElements.size(); + } + + /// @brief add parent element + void insert(T element) { + myVectorElements.push_back(element); + } + + /// @brief remove parent element + bool erase(T element) { + auto it = std::find(myVectorElements.begin(), myVectorElements.end(), element); + if (it != myVectorElements.end()) { + myVectorElements.erase(it); + return true; + } else { + return false; + } + } + + /// @brief update all elements + void set(const std::vector& elements) { + myVectorElements.clear(); + myVectorElements.reserve(elements.size()); + for (const auto &element : elements) { + myVectorElements.push_back(element); + } + } + +private: + /// @brief elements vector + std::vector myVectorElements; +}; diff --git a/src/netedit/elements/GNEHierarchicalElement.cpp b/src/netedit/elements/GNEHierarchicalElement.cpp index 7517a8cc8e5c..86e72b6be1cd 100644 --- a/src/netedit/elements/GNEHierarchicalElement.cpp +++ b/src/netedit/elements/GNEHierarchicalElement.cpp @@ -107,33 +107,33 @@ GNEHierarchicalElement::getAllHierarchicalElements() const { } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerParents& GNEHierarchicalElement::getParentJunctions() const { return myHierarchicalStructure.getParents(); } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerParents& GNEHierarchicalElement::getParentEdges() const { return myHierarchicalStructure.getParents(); } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerParents& GNEHierarchicalElement::getParentLanes() const { return myHierarchicalStructure.getParents(); } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerParents& GNEHierarchicalElement::getParentAdditionals() const { return myHierarchicalStructure.getParents(); } -const GNEHierarchicalContainer +const GNEHierarchicalContainerParents GNEHierarchicalElement::getParentStoppingPlaces() const { - GNEHierarchicalContainer stoppingPlaces; + GNEHierarchicalContainerParents stoppingPlaces; for (const auto& additional : getParentAdditionals()) { if (additional->getTagProperty().isStoppingPlace()) { stoppingPlaces.push_back(additional); @@ -143,9 +143,9 @@ GNEHierarchicalElement::getParentStoppingPlaces() const { } -const GNEHierarchicalContainer +const GNEHierarchicalContainerParents GNEHierarchicalElement::getParentTAZs() const { - GNEHierarchicalContainer TAZs; + GNEHierarchicalContainerParents TAZs; for (const auto& additional : getParentAdditionals()) { if (additional->getTagProperty().isTAZElement()) { TAZs.push_back(additional); @@ -155,49 +155,49 @@ GNEHierarchicalElement::getParentTAZs() const { } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerParents& GNEHierarchicalElement::getParentDemandElements() const { return myHierarchicalStructure.getParents(); } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerParents& GNEHierarchicalElement::getParentGenericDatas() const { return myHierarchicalStructure.getParents(); } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerChildren& GNEHierarchicalElement::getChildJunctions() const { return myHierarchicalStructure.getChildren(); } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerChildren& GNEHierarchicalElement::getChildEdges() const { return myHierarchicalStructure.getChildren(); } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerChildren& GNEHierarchicalElement::getChildLanes() const { return myHierarchicalStructure.getChildren(); } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerChildren& GNEHierarchicalElement::getChildAdditionals() const { return myHierarchicalStructure.getChildren(); } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerChildren& GNEHierarchicalElement::getChildDemandElements() const { return myHierarchicalStructure.getChildren(); } -const GNEHierarchicalContainer& +const GNEHierarchicalContainerChildren& GNEHierarchicalElement::getChildGenericDatas() const { return myHierarchicalStructure.getChildren(); } diff --git a/src/netedit/elements/GNEHierarchicalElement.h b/src/netedit/elements/GNEHierarchicalElement.h index f1f6a759c64e..2b5f0457f6db 100644 --- a/src/netedit/elements/GNEHierarchicalElement.h +++ b/src/netedit/elements/GNEHierarchicalElement.h @@ -89,46 +89,46 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { std::vector getAllHierarchicalElements() const; /// @brief get parent junctions - const GNEHierarchicalContainer& getParentJunctions() const; + const GNEHierarchicalContainerParents& getParentJunctions() const; /// @brief get parent edges - const GNEHierarchicalContainer& getParentEdges() const; + const GNEHierarchicalContainerParents& getParentEdges() const; /// @brief get parent lanes - const GNEHierarchicalContainer& getParentLanes() const; + const GNEHierarchicalContainerParents& getParentLanes() const; /// @brief get parent additionals - const GNEHierarchicalContainer& getParentAdditionals() const; + const GNEHierarchicalContainerParents& getParentAdditionals() const; /// @brief get parent stoppingPlaces (used by plans) - const GNEHierarchicalContainer getParentStoppingPlaces() const; + const GNEHierarchicalContainerParents getParentStoppingPlaces() const; /// @brief get parent TAZs (used by plans) - const GNEHierarchicalContainer getParentTAZs() const; + const GNEHierarchicalContainerParents getParentTAZs() const; /// @brief get parent demand elements - const GNEHierarchicalContainer& getParentDemandElements() const; + const GNEHierarchicalContainerParents& getParentDemandElements() const; /// @brief get parent demand elements - const GNEHierarchicalContainer& getParentGenericDatas() const; + const GNEHierarchicalContainerParents& getParentGenericDatas() const; /// @brief get child junctions - const GNEHierarchicalContainer& getChildJunctions() const; + const GNEHierarchicalContainerChildren& getChildJunctions() const; /// @brief get child edges - const GNEHierarchicalContainer& getChildEdges() const; + const GNEHierarchicalContainerChildren& getChildEdges() const; /// @brief get child lanes - const GNEHierarchicalContainer& getChildLanes() const; + const GNEHierarchicalContainerChildren& getChildLanes() const; /// @brief return child additionals - const GNEHierarchicalContainer& getChildAdditionals() const; + const GNEHierarchicalContainerChildren& getChildAdditionals() const; /// @brief return child demand elements - const GNEHierarchicalContainer& getChildDemandElements() const; + const GNEHierarchicalContainerChildren& getChildDemandElements() const; /// @brief return child generic data elements - const GNEHierarchicalContainer& getChildGenericDatas() const; + const GNEHierarchicalContainerChildren& getChildGenericDatas() const; /// @} diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index 0ea7c1705473..f3064ec3e2e7 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -42,12 +42,12 @@ GNEHierarchicalStructure::GNEHierarchicalStructure( const std::vector& parentAdditionals, const std::vector& parentDemandElements, const std::vector& parentGenericDatas): - myParentJunctions(parentJunctions, HierarchicalContainerType::BASIC), - myParentEdges(parentEdges, HierarchicalContainerType::BASIC), - myParentLanes(parentLanes, HierarchicalContainerType::BASIC), - myParentAdditionals(parentAdditionals, HierarchicalContainerType::BASIC), - myParentDemandElements(parentDemandElements, HierarchicalContainerType::BASIC), - myParentGenericDatas(parentGenericDatas, HierarchicalContainerType::BASIC) { + myParentJunctions(parentJunctions), + myParentEdges(parentEdges), + myParentLanes(parentLanes), + myParentAdditionals(parentAdditionals), + myParentDemandElements(parentDemandElements), + myParentGenericDatas(parentGenericDatas) { } @@ -239,37 +239,37 @@ GNEHierarchicalStructure::removeChildElement(GNEGenericData* genericData) { } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerParents& GNEHierarchicalStructure::getParents() const { return myParentJunctions; } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerParents& GNEHierarchicalStructure::getParents() const { return myParentEdges; } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerParents& GNEHierarchicalStructure::getParents() const { return myParentLanes; } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerParents& GNEHierarchicalStructure::getParents() const { return myParentAdditionals; } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerParents& GNEHierarchicalStructure::getParents() const { return myParentDemandElements; } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerParents& GNEHierarchicalStructure::getParents() const { return myParentGenericDatas; } @@ -311,37 +311,37 @@ GNEHierarchicalStructure::setParents(const std::vector& newPare } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerChildren& GNEHierarchicalStructure::getChildren() const { return myChildJunctions; } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerChildren& GNEHierarchicalStructure::getChildren() const { return myChildEdges; } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerChildren& GNEHierarchicalStructure::getChildren() const { return myChildLanes; } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerChildren& GNEHierarchicalStructure::getChildren() const { return myChildAdditionals; } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerChildren& GNEHierarchicalStructure::getChildren() const { return myChildDemandElements; } -template<> const GNEHierarchicalContainer& +template<> const GNEHierarchicalContainerChildren& GNEHierarchicalStructure::getChildren() const { return myChildGenericDatas; } diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index c57948f07a75..3d571c7efffc 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -22,7 +22,8 @@ #include -#include "GNEHierarchicalContainer.h" +#include "GNEHierarchicalContainerParents.h" +#include "GNEHierarchicalContainerChildren.h" // =========================================================================== // class declarations @@ -78,7 +79,7 @@ class GNEHierarchicalStructure { /// @brief get parents template - const GNEHierarchicalContainer& getParents() const; + const GNEHierarchicalContainerParents& getParents() const; /// @brief set parents template @@ -86,7 +87,7 @@ class GNEHierarchicalStructure { /// @brief get children template - const GNEHierarchicalContainer& getChildren() const; + const GNEHierarchicalContainerChildren& getChildren() const; /// @brief set children template @@ -94,38 +95,38 @@ class GNEHierarchicalStructure { private: /// @brief parents junctions - GNEHierarchicalContainer myParentJunctions; + GNEHierarchicalContainerParents myParentJunctions; /// @brief parents edges - GNEHierarchicalContainer myParentEdges; + GNEHierarchicalContainerParents myParentEdges; /// @brief parents lanes - GNEHierarchicalContainer myParentLanes; + GNEHierarchicalContainerParents myParentLanes; /// @brief parents additionals - GNEHierarchicalContainer myParentAdditionals; + GNEHierarchicalContainerParents myParentAdditionals; /// @brief parents demand elements - GNEHierarchicalContainer myParentDemandElements; + GNEHierarchicalContainerParents myParentDemandElements; /// @brief parents generic datas - GNEHierarchicalContainer myParentGenericDatas; + GNEHierarchicalContainerParents myParentGenericDatas; /// @brief children junctions - GNEHierarchicalContainer myChildJunctions; + GNEHierarchicalContainerChildren myChildJunctions; /// @brief children edges - GNEHierarchicalContainer myChildEdges; + GNEHierarchicalContainerChildren myChildEdges; /// @brief children lanes - GNEHierarchicalContainer myChildLanes; + GNEHierarchicalContainerChildren myChildLanes; /// @brief children additional elements - GNEHierarchicalContainer myChildAdditionals; + GNEHierarchicalContainerChildren myChildAdditionals; /// @brief children demand elements - GNEHierarchicalContainer myChildDemandElements; + GNEHierarchicalContainerChildren myChildDemandElements; /// @brief children genericdata elements - GNEHierarchicalContainer myChildGenericDatas; + GNEHierarchicalContainerChildren myChildGenericDatas; }; From a106a2a54479a676c886bd079d5af40c855f9b19 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 12:23:41 +0100 Subject: [PATCH 043/116] simplified GNEHierarchicalContainerChildren. Refs #16039 --- src/netedit/changes/GNEChange_Children.h | 4 +- src/netedit/changes/GNEChange_Edge.cpp | 6 +- src/netedit/changes/GNEChange_Edge.h | 12 ++-- .../GNEHierarchicalContainerChildren.h | 59 ++----------------- .../GNEHierarchicalContainerParents.h | 58 ++---------------- .../elements/GNEHierarchicalStructure.cpp | 54 +++++++++++------ 6 files changed, 57 insertions(+), 136 deletions(-) diff --git a/src/netedit/changes/GNEChange_Children.h b/src/netedit/changes/GNEChange_Children.h index 7cad5edb7ef3..7c2e49075568 100644 --- a/src/netedit/changes/GNEChange_Children.h +++ b/src/netedit/changes/GNEChange_Children.h @@ -76,8 +76,8 @@ class GNEChange_Children : public GNEChange { const Operation myOperation; /// @brief copy of child demand elements before apply operation - const std::vector myOriginalChildElements; + const GNEHierarchicalContainerChildren myOriginalChildElements; /// @brief element children after apply operation - std::vector myEditedChildElements; + GNEHierarchicalContainerChildren myEditedChildElements; }; diff --git a/src/netedit/changes/GNEChange_Edge.cpp b/src/netedit/changes/GNEChange_Edge.cpp index 09b178f893f6..566bacc8e0f5 100644 --- a/src/netedit/changes/GNEChange_Edge.cpp +++ b/src/netedit/changes/GNEChange_Edge.cpp @@ -46,9 +46,9 @@ GNEChange_Edge::GNEChange_Edge(GNEEdge* edge, bool forward): myLaneParentAdditionals.push_back(lane->getParentAdditionals()); myLaneParentDemandElements.push_back(lane->getParentDemandElements()); myLaneParentGenericData.push_back(lane->getParentGenericDatas()); - myChildLaneAdditionals.push_back(lane->getChildAdditionals()); - myChildLaneDemandElements.push_back(lane->getChildDemandElements()); - myChildLaneGenericData.push_back(lane->getChildGenericDatas()); + myChildLaneAdditionals.push_back(lane->getChildAdditionals().getCopy()); + myChildLaneDemandElements.push_back(lane->getChildDemandElements().getCopy()); + myChildLaneGenericData.push_back(lane->getChildGenericDatas().getCopy()); } } diff --git a/src/netedit/changes/GNEChange_Edge.h b/src/netedit/changes/GNEChange_Edge.h index e765f44d0967..c0c3536025bc 100644 --- a/src/netedit/changes/GNEChange_Edge.h +++ b/src/netedit/changes/GNEChange_Edge.h @@ -66,22 +66,22 @@ class GNEChange_Edge : public GNEChange { void removeEdgeLanes(); /// @brief vector of references to vector of parent additionals (used by edge lanes) - std::vector > myLaneParentAdditionals; + std::vector > myLaneParentAdditionals; /// @brief vector of references to vector of parent demand elements (used by edge lanes) - std::vector > myLaneParentDemandElements; + std::vector > myLaneParentDemandElements; /// @brief vector of references to vector of parent generic datas (used by edge lanes) - std::vector > myLaneParentGenericData; + std::vector > myLaneParentGenericData; /// @brief vector of references to vector of child additional (used by edge lanes) - std::vector > myChildLaneAdditionals; + std::vector > myChildLaneAdditionals; /// @brief vector of references to vector of child demand elements (used by edge lanes) - std::vector > myChildLaneDemandElements; + std::vector > myChildLaneDemandElements; /// @brief vector of references to vector of child generic datas (used by edge lanes) - std::vector > myChildLaneGenericData; + std::vector > myChildLaneGenericData; private: /**@brief full information regarding the edge that is to be created/deleted diff --git a/src/netedit/elements/GNEHierarchicalContainerChildren.h b/src/netedit/elements/GNEHierarchicalContainerChildren.h index 68ca0d2b9622..33d43170d336 100644 --- a/src/netedit/elements/GNEHierarchicalContainerChildren.h +++ b/src/netedit/elements/GNEHierarchicalContainerChildren.h @@ -22,22 +22,6 @@ #include - -#define MAX_HIERARCHICAL_PARENTS 10 - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNENetworkElement; -class GNEJunction; -class GNEEdge; -class GNELane; -class GNEAdditional; -class GNEDemandElement; -class GNEGenericData; -class GNEHierarchicalElement; - // =========================================================================== // class definitions // =========================================================================== @@ -47,44 +31,13 @@ class GNEHierarchicalContainerChildren : public std::vector { public: /// @brief default constructor - GNEHierarchicalContainerChildren() {} - - /// @brief parameter constructor - GNEHierarchicalContainerChildren(const std::vector& elements) { - myVectorElements = elements; + GNEHierarchicalContainerChildren() { + // we reserve at least 5 positions + reserve(5); } - /// @brief get container size - size_t size() const { - return myVectorElements.size(); - } - - /// @brief add parent element - void insert(T element) { - myVectorElements.push_back(element); - } - - /// @brief remove parent element - bool erase(T element) { - auto it = std::find(myVectorElements.begin(), myVectorElements.end(), element); - if (it != myVectorElements.end()) { - myVectorElements.erase(it); - return true; - } else { - return false; - } - } - - /// @brief update all elements - void set(const std::vector& elements) { - myVectorElements.clear(); - myVectorElements.reserve(elements.size()); - for (const auto &element : elements) { - myVectorElements.push_back(element); - } + /// @brief parameter constructor + GNEHierarchicalContainerChildren(const std::vector& elements) : + std::vector(elements) { } - -private: - /// @brief elements vector - std::vector myVectorElements; }; diff --git a/src/netedit/elements/GNEHierarchicalContainerParents.h b/src/netedit/elements/GNEHierarchicalContainerParents.h index 48e8670783ff..d9ce48230147 100644 --- a/src/netedit/elements/GNEHierarchicalContainerParents.h +++ b/src/netedit/elements/GNEHierarchicalContainerParents.h @@ -22,22 +22,6 @@ #include - -#define MAX_HIERARCHICAL_PARENTS 10 - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNENetworkElement; -class GNEJunction; -class GNEEdge; -class GNELane; -class GNEAdditional; -class GNEDemandElement; -class GNEGenericData; -class GNEHierarchicalElement; - // =========================================================================== // class definitions // =========================================================================== @@ -48,46 +32,12 @@ class GNEHierarchicalContainerParents : public std::vector { public: /// @brief default constructor GNEHierarchicalContainerParents() { - myVectorElements.reserve(10); + // we reserve at least 5 positions + reserve(5); } /// @brief parameter constructor - GNEHierarchicalContainerParents(const std::vector& elements) { - myVectorElements.reserve(10); - myVectorElements = elements; - } - - /// @brief get container size - size_t size() const { - return myVectorElements.size(); + GNEHierarchicalContainerParents(const std::vector& elements) : + std::vector(elements) { } - - /// @brief add parent element - void insert(T element) { - myVectorElements.push_back(element); - } - - /// @brief remove parent element - bool erase(T element) { - auto it = std::find(myVectorElements.begin(), myVectorElements.end(), element); - if (it != myVectorElements.end()) { - myVectorElements.erase(it); - return true; - } else { - return false; - } - } - - /// @brief update all elements - void set(const std::vector& elements) { - myVectorElements.clear(); - myVectorElements.reserve(elements.size()); - for (const auto &element : elements) { - myVectorElements.push_back(element); - } - } - -private: - /// @brief elements vector - std::vector myVectorElements; }; diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index f3064ec3e2e7..2bab0120d905 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -72,43 +72,46 @@ GNEHierarchicalStructure::getContainerSize() const { template <> void GNEHierarchicalStructure::addParentElement(GNEJunction* junction) { - myParentJunctions.insert(junction); + myParentJunctions.push_back(junction); } template <> void GNEHierarchicalStructure::addParentElement(GNEEdge* edge) { - myParentEdges.insert(edge); + myParentEdges.push_back(edge); } template <> void GNEHierarchicalStructure::addParentElement(GNELane* lane) { - myParentLanes.insert(lane); + myParentLanes.push_back(lane); } template <> void GNEHierarchicalStructure::addParentElement(GNEAdditional* additional) { - myParentAdditionals.insert(additional); + myParentAdditionals.push_back(additional); } template <> void GNEHierarchicalStructure::addParentElement(GNEDemandElement* demandElement) { - myParentDemandElements.insert(demandElement); + myParentDemandElements.push_back(demandElement); } template <> void GNEHierarchicalStructure::addParentElement(GNEGenericData* genericData) { - myParentGenericDatas.insert(genericData); + myParentGenericDatas.push_back(genericData); } template <> void GNEHierarchicalStructure::removeParentElement(GNEJunction* junction) { - if (myParentJunctions.erase(junction) == false) { + auto it = std::find(myParentJunctions.begin(), myParentJunctions.end(), junction); + if (it != myParentJunctions.end()) { + myParentJunctions.erase(it); + } else { throw ProcessError(junction->getTagStr() + " with ID='" + junction->getID() + "' is not a parent element"); } } @@ -116,7 +119,10 @@ GNEHierarchicalStructure::removeParentElement(GNEJunction* junction) { template <> void GNEHierarchicalStructure::removeParentElement(GNEEdge* edge) { - if (myParentEdges.erase(edge) == false) { + auto it = std::find(myParentEdges.begin(), myParentEdges.end(), edge); + if (it != myParentEdges.end()) { + myParentEdges.erase(it); + } else { throw ProcessError(edge->getTagStr() + " with ID='" + edge->getID() + "' is not a parent element"); } } @@ -124,7 +130,10 @@ GNEHierarchicalStructure::removeParentElement(GNEEdge* edge) { template <> void GNEHierarchicalStructure::removeParentElement(GNELane* lane) { - if (myParentLanes.erase(lane) == false) { + auto it = std::find(myParentLanes.begin(), myParentLanes.end(), lane); + if (it != myParentLanes.end()) { + myParentLanes.erase(it); + } else { throw ProcessError(lane->getTagStr() + " with ID='" + lane->getID() + "' is not a parent element"); } } @@ -132,7 +141,10 @@ GNEHierarchicalStructure::removeParentElement(GNELane* lane) { template <> void GNEHierarchicalStructure::removeParentElement(GNEAdditional* additional) { - if (myParentAdditionals.erase(additional) == false) { + auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional); + if (it != myParentAdditionals.end()) { + myParentAdditionals.erase(it); + } else { throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' is not a parent element"); } } @@ -140,7 +152,10 @@ GNEHierarchicalStructure::removeParentElement(GNEAdditional* additional) { template <> void GNEHierarchicalStructure::removeParentElement(GNEDemandElement* demandElement) { - if (myParentDemandElements.erase(demandElement) == false) { + auto it = std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement); + if (it != myParentDemandElements.end()) { + myParentDemandElements.erase(it); + } else { throw ProcessError(demandElement->getTagStr() + " is not a parent element"); } } @@ -148,7 +163,10 @@ GNEHierarchicalStructure::removeParentElement(GNEDemandElement* demandElement) { template <> void GNEHierarchicalStructure::removeParentElement(GNEGenericData* genericData) { - if (myParentGenericDatas.erase(genericData) == false) { + auto it = std::find(myParentGenericDatas.begin(), myParentGenericDatas.end(), genericData); + if (it != myParentGenericDatas.end()) { + myParentGenericDatas.erase(it); + } else { throw ProcessError(genericData->getTagStr() + " is not a parent element"); } } @@ -277,37 +295,37 @@ GNEHierarchicalStructure::getParents() const { template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentJunctions.set(newParents); + myParentJunctions = newParents; } template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentEdges.set(newParents); + myParentEdges = newParents; } template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentLanes.set(newParents); + myParentLanes = newParents; } template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentAdditionals.set(newParents); + myParentAdditionals = newParents; } template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentDemandElements.set(newParents); + myParentDemandElements = newParents; } template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { - myParentGenericDatas.set(newParents); + myParentGenericDatas = newParents; } From 558830460b5c3924ca6a3769b874305ba0f88aa4 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 14:09:48 +0100 Subject: [PATCH 044/116] Fixed build errors due a forgotten saving. Refs #16039 --- src/netedit/changes/GNEChange_Edge.cpp | 6 +-- src/netedit/changes/GNEChange_Edge.h | 6 +-- .../elements/GNEHierarchicalStructure.cpp | 54 ++++++++++++------- 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/src/netedit/changes/GNEChange_Edge.cpp b/src/netedit/changes/GNEChange_Edge.cpp index 566bacc8e0f5..09b178f893f6 100644 --- a/src/netedit/changes/GNEChange_Edge.cpp +++ b/src/netedit/changes/GNEChange_Edge.cpp @@ -46,9 +46,9 @@ GNEChange_Edge::GNEChange_Edge(GNEEdge* edge, bool forward): myLaneParentAdditionals.push_back(lane->getParentAdditionals()); myLaneParentDemandElements.push_back(lane->getParentDemandElements()); myLaneParentGenericData.push_back(lane->getParentGenericDatas()); - myChildLaneAdditionals.push_back(lane->getChildAdditionals().getCopy()); - myChildLaneDemandElements.push_back(lane->getChildDemandElements().getCopy()); - myChildLaneGenericData.push_back(lane->getChildGenericDatas().getCopy()); + myChildLaneAdditionals.push_back(lane->getChildAdditionals()); + myChildLaneDemandElements.push_back(lane->getChildDemandElements()); + myChildLaneGenericData.push_back(lane->getChildGenericDatas()); } } diff --git a/src/netedit/changes/GNEChange_Edge.h b/src/netedit/changes/GNEChange_Edge.h index c0c3536025bc..756791052167 100644 --- a/src/netedit/changes/GNEChange_Edge.h +++ b/src/netedit/changes/GNEChange_Edge.h @@ -75,13 +75,13 @@ class GNEChange_Edge : public GNEChange { std::vector > myLaneParentGenericData; /// @brief vector of references to vector of child additional (used by edge lanes) - std::vector > myChildLaneAdditionals; + std::vector > myChildLaneAdditionals; /// @brief vector of references to vector of child demand elements (used by edge lanes) - std::vector > myChildLaneDemandElements; + std::vector > myChildLaneDemandElements; /// @brief vector of references to vector of child generic datas (used by edge lanes) - std::vector > myChildLaneGenericData; + std::vector > myChildLaneGenericData; private: /**@brief full information regarding the edge that is to be created/deleted diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index 2bab0120d905..186ad8467573 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -174,44 +174,47 @@ GNEHierarchicalStructure::removeParentElement(GNEGenericData* genericData) { template <> void GNEHierarchicalStructure::addChildElement(GNEJunction* junction) { - myChildJunctions.insert(junction); + myChildJunctions.push_back(junction); } template <> void GNEHierarchicalStructure::addChildElement(GNEEdge* edge) { - myChildEdges.insert(edge); + myChildEdges.push_back(edge); } template <> void GNEHierarchicalStructure::addChildElement(GNELane* lane) { - myChildLanes.insert(lane); + myChildLanes.push_back(lane); } template <> void GNEHierarchicalStructure::addChildElement(GNEAdditional* additional) { - myChildAdditionals.insert(additional); + myChildAdditionals.push_back(additional); } template <> void GNEHierarchicalStructure::addChildElement(GNEDemandElement* demandElement) { - myChildDemandElements.insert(demandElement); + myChildDemandElements.push_back(demandElement); } template <> void GNEHierarchicalStructure::addChildElement(GNEGenericData* genericData) { - myChildGenericDatas.insert(genericData); + myChildGenericDatas.push_back(genericData); } template <> void GNEHierarchicalStructure::removeChildElement(GNEJunction* junction) { - if (myChildJunctions.erase(junction) == false) { + auto it = std::find(myChildJunctions.begin(), myChildJunctions.end(), junction); + if (it != myChildJunctions.end()) { + myChildJunctions.erase(it); + } else { throw ProcessError(junction->getTagStr() + " is not a child element"); } } @@ -219,7 +222,10 @@ GNEHierarchicalStructure::removeChildElement(GNEJunction* junction) { template <> void GNEHierarchicalStructure::removeChildElement(GNEEdge* edge) { - if (myChildEdges.erase(edge) == false) { + auto it = std::find(myChildEdges.begin(), myChildEdges.end(), edge); + if (it != myChildEdges.end()) { + myChildEdges.erase(it); + } else { throw ProcessError(edge->getTagStr() + " is not a child element"); } } @@ -227,7 +233,10 @@ GNEHierarchicalStructure::removeChildElement(GNEEdge* edge) { template <> void GNEHierarchicalStructure::removeChildElement(GNELane* lane) { - if (myChildLanes.erase(lane) == false) { + auto it = std::find(myChildLanes.begin(), myChildLanes.end(), lane); + if (it != myChildLanes.end()) { + myChildLanes.erase(it); + } else { throw ProcessError(lane->getTagStr() + " is not a child element"); } } @@ -235,7 +244,10 @@ GNEHierarchicalStructure::removeChildElement(GNELane* lane) { template <> void GNEHierarchicalStructure::removeChildElement(GNEAdditional* additional) { - if (myChildAdditionals.erase(additional) == false) { + auto it = std::find(myChildAdditionals.begin(), myChildAdditionals.end(), additional); + if (it != myChildAdditionals.end()) { + myChildAdditionals.erase(it); + } else { throw ProcessError(additional->getTagStr() + " is not a child element"); } } @@ -243,7 +255,10 @@ GNEHierarchicalStructure::removeChildElement(GNEAdditional* additional) { template <> void GNEHierarchicalStructure::removeChildElement(GNEDemandElement* demandElement) { - if (myChildDemandElements.erase(demandElement) == false) { + auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); + if (it != myChildDemandElements.end()) { + myChildDemandElements.erase(it); + } else { throw ProcessError(demandElement->getTagStr() + " is not a child element"); } } @@ -251,7 +266,10 @@ GNEHierarchicalStructure::removeChildElement(GNEDemandElement* demandElement) { template <> void GNEHierarchicalStructure::removeChildElement(GNEGenericData* genericData) { - if (myChildGenericDatas.erase(genericData) == false) { + auto it = std::find(myChildGenericDatas.begin(), myChildGenericDatas.end(), genericData); + if (it != myChildGenericDatas.end()) { + myChildGenericDatas.erase(it); + } else { throw ProcessError(genericData->getTagStr() + " is not a child element"); } } @@ -367,37 +385,37 @@ GNEHierarchicalStructure::getChildren() const { template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildJunctions.set(newChildren); + myChildJunctions = newChildren; } template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildEdges.set(newChildren); + myChildEdges = newChildren; } template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildLanes.set(newChildren); + myChildLanes = newChildren; } template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildAdditionals.set(newChildren); + myChildAdditionals = newChildren; } template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildDemandElements.set(newChildren); + myChildDemandElements = newChildren; } template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildGenericDatas.set(newChildren); + myChildGenericDatas = newChildren; } /****************************************************************************/ From 9e85fd2bc7f1b5382f65c8051cbe270abd9b05e0 Mon Sep 17 00:00:00 2001 From: Mirko Barthauer Date: Mon, 20 Jan 2025 12:58:22 +0000 Subject: [PATCH 045/116] Translated using Weblate (German) Currently translated at 99.3% (3642 of 3667 strings) Translation: Eclipse SUMO/SUMO GUI / Netedit Translate-URL: https://hosted.weblate.org/projects/eclipse-sumo/sumo-gui-netedit/de/ --- data/po/de_gui.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/po/de_gui.po b/data/po/de_gui.po index 581f2026b1be..92f68f4ede30 100644 --- a/data/po/de_gui.po +++ b/data/po/de_gui.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: sumo\n" "Report-Msgid-Bugs-To: sumo-dev@eclipse.org\n" "POT-Creation-Date: 2025-01-02 15:02+0100\n" -"PO-Revision-Date: 2025-01-14 11:40+0000\n" +"PO-Revision-Date: 2025-01-20 13:51+0000\n" "Last-Translator: Mirko Barthauer \n" "Language-Team: German \n" @@ -10326,7 +10326,7 @@ msgstr "" #: src/netedit/elements/GNEAttributeCarrier.cpp:8400 msgid "Toggle front element" -msgstr "Oberstes Element festhalten" +msgstr "Oberstes Element durchschalten" #: src/netedit/elements/GNEAttributeCarrier.cpp:8404 msgid "Toggle select element" From bb7357bd0780d45592a9fc2368c196c406415e94 Mon Sep 17 00:00:00 2001 From: Mirko Barthauer Date: Mon, 20 Jan 2025 13:48:09 +0000 Subject: [PATCH 046/116] Translated using Weblate (Italian) Currently translated at 94.2% (3456 of 3665 strings) Translation: Eclipse SUMO/SUMO GUI / Netedit Translate-URL: https://hosted.weblate.org/projects/eclipse-sumo/sumo-gui-netedit/it/ --- data/po/it_gui.po | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/data/po/it_gui.po b/data/po/it_gui.po index 28f90d249ab6..ddf7a2d844ef 100644 --- a/data/po/it_gui.po +++ b/data/po/it_gui.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: sumo\n" "Report-Msgid-Bugs-To: sumo-dev@eclipse.org\n" "POT-Creation-Date: 2025-01-02 15:02+0100\n" -"PO-Revision-Date: 2025-01-10 15:16+0000\n" +"PO-Revision-Date: 2025-01-20 13:51+0000\n" "Last-Translator: Mirko Barthauer \n" "Language-Team: Italian \n" @@ -9681,7 +9681,7 @@ msgstr "incrocio" #: src/netedit/elements/GNEAttributeCarrier.cpp:8342 #: src/utils/gui/div/GUIMessageWindow.cpp:77 msgid "busStop" -msgstr "" +msgstr "fermata di autobus" #: src/netedit/elements/GNEAttributeCarrier.cpp:4902 #: src/netedit/elements/GNEAttributeCarrier.cpp:4983 @@ -9762,7 +9762,7 @@ msgstr "" #: src/netedit/elements/GNEAttributeCarrier.cpp:8353 #: src/utils/gui/div/GUIMessageWindow.cpp:78 msgid "trainStop" -msgstr "" +msgstr "fermata ferroviaria" #: src/netedit/elements/GNEAttributeCarrier.cpp:4912 #: src/netedit/elements/GNEAttributeCarrier.cpp:4993 @@ -9843,7 +9843,7 @@ msgstr "" #: src/netedit/elements/GNEAttributeCarrier.cpp:8364 #: src/utils/gui/div/GUIMessageWindow.cpp:79 msgid "containerStop" -msgstr "" +msgstr "fermata di contenitori" #: src/netedit/elements/GNEAttributeCarrier.cpp:4922 #: src/netedit/elements/GNEAttributeCarrier.cpp:5003 @@ -9924,7 +9924,7 @@ msgstr "" #: src/netedit/elements/GNEAttributeCarrier.cpp:8374 #: src/utils/gui/div/GUIMessageWindow.cpp:80 msgid "chargingStation" -msgstr "" +msgstr "stazione di ricarica" #: src/netedit/elements/GNEAttributeCarrier.cpp:4932 #: src/netedit/elements/GNEAttributeCarrier.cpp:5013 @@ -10005,7 +10005,7 @@ msgstr "" #: src/netedit/elements/GNEAttributeCarrier.cpp:8385 #: src/utils/gui/div/GUIMessageWindow.cpp:82 msgid "parkingArea" -msgstr "" +msgstr "parcheggio" #: src/netedit/elements/GNEAttributeCarrier.cpp:5524 #: src/netedit/elements/GNEAttributeCarrier.cpp:5533 @@ -10074,7 +10074,7 @@ msgstr "" #: src/netedit/elements/GNEAttributeCarrier.cpp:6171 #: src/netedit/elements/GNEAttributeCarrier.cpp:6181 msgid "Tranship" -msgstr "" +msgstr "Trasbordo" #: src/netedit/elements/GNEAttributeCarrier.cpp:5533 #: src/netedit/elements/GNEAttributeCarrier.cpp:6971 @@ -10218,7 +10218,7 @@ msgstr "" #: src/netedit/elements/GNEAttributeCarrier.cpp:7619 #: src/netedit/elements/GNEAttributeCarrier.cpp:7629 msgid "Walk" -msgstr "" +msgstr "Cammino" #: src/netedit/elements/GNEAttributeCarrier.cpp:7662 #: src/netedit/elements/GNEAttributeCarrier.cpp:7672 @@ -10285,7 +10285,7 @@ msgstr "" #: src/netedit/elements/GNEAttributeCarrier.cpp:8289 #: src/netedit/elements/GNEAttributeCarrier.cpp:8299 msgid "Ride" -msgstr "" +msgstr "Corsa" #: src/netedit/elements/GNEAttributeCarrier.cpp:8322 #: src/netedit/elements/GNEAttributeCarrier.cpp:8331 @@ -10407,11 +10407,11 @@ msgstr "Partenza iniziale del flusso" #: src/netedit/elements/GNEAttributeCarrier.cpp:8579 msgid "Criterion for flow termination" -msgstr "" +msgstr "Criterio per terminare il flusso" #: src/netedit/elements/GNEAttributeCarrier.cpp:8586 msgid "Criterion for flow spacing" -msgstr "" +msgstr "Criterio per spaziare il flusso" #: src/netedit/elements/GNEAttributeCarrier.cpp:8599 #: src/netedit/elements/GNEAttributeCarrier.cpp:8620 @@ -10886,7 +10886,7 @@ msgstr "Il colore del contenitore" #: src/netedit/elements/GNEAttributeCarrier.cpp:9169 msgid "The position at which the container shall enter the net" -msgstr "" +msgstr "La posizione dove il contenitore deve entrare nella rete" #: src/netedit/elements/GNEAttributeCarrier.cpp:9182 #: src/netedit/elements/GNEAttributeCarrier.cpp:9573 @@ -11005,11 +11005,11 @@ msgstr "Codice identificativo della fermata di contenitori" #: src/netedit/elements/GNEAttributeCarrier.cpp:9337 msgid "Charging station ID" -msgstr "" +msgstr "Codice identificativo di stazione di ricarica" #: src/netedit/elements/GNEAttributeCarrier.cpp:9343 msgid "Parking area ID" -msgstr "" +msgstr "Codice identicativo di parcheggio" #: src/netedit/elements/GNEAttributeCarrier.cpp:9350 msgid "Edge start ID" @@ -11026,7 +11026,7 @@ msgstr "Codice identificativo dell'incrocio di origine" #: src/netedit/elements/GNEAttributeCarrier.cpp:9368 msgid "BusStop start ID" -msgstr "" +msgstr "Codice identificativo di fermata di autobus" #: src/netedit/elements/GNEAttributeCarrier.cpp:9374 msgid "TrainStop start ID" @@ -11038,7 +11038,7 @@ msgstr "Codice identificativo della fermata di contenitori di origine" #: src/netedit/elements/GNEAttributeCarrier.cpp:9386 msgid "ChargingStation start ID" -msgstr "" +msgstr "Codice identificativo della stazione di ricarica di partenza" #: src/netedit/elements/GNEAttributeCarrier.cpp:9392 msgid "ParkingArea start ID" @@ -11759,7 +11759,7 @@ msgstr "" #: src/netedit/elements/additional/GNEMultiEntryExitDetector.cpp:121 msgid "' needs at least one entry and one exit" -msgstr "" +msgstr "' richiede almeno un'entrata e un'uscita" #: src/netedit/elements/additional/GNEMultiEntryExitDetector.cpp:359 msgid "An entry-exit detector needs at least one entry detector" @@ -11897,16 +11897,16 @@ msgstr "" #: src/netedit/elements/data/GNEDataHandler.cpp:230 msgid "There is already a TAZ rel defined between '%' and '%'." -msgstr "" +msgstr "Esiste già una relazione origine-destinazione tra '%' e '%'." #: src/netedit/elements/data/GNEDataHandler.cpp:232 msgid "There is already a TAZ rel defined in '%'." -msgstr "" +msgstr "E già stata definita una relazione origine-destinazione in '%'." #: src/netedit/elements/data/GNEDataHandler.cpp:236 #: src/netedit/elements/data/GNEDataHandler.cpp:248 msgid "add TAZ rel" -msgstr "" +msgstr "aggiuni relazione di origine-destinazione" #: src/netedit/elements/data/GNEDataInterval.cpp:221 msgid "GenericData was already inserted" @@ -11980,19 +11980,19 @@ msgstr "L'arco '%' non segue l'arco '%'" #: src/netedit/elements/demand/GNEPlanParents.cpp:115 msgid "Invalid from edge '%' used in % of % '%'" -msgstr "" +msgstr "Arco di partenza invalido '%' utilizzato in % di % '%'" #: src/netedit/elements/demand/GNEPlanParents.cpp:118 msgid "Invalid to edge '%' used in % of % '%'" -msgstr "" +msgstr "Arco di arrivo invalido '%' utilizzato in % di % '%'" #: src/netedit/elements/demand/GNEPlanParents.cpp:121 msgid "Invalid from junction '%' used in % of % '%'" -msgstr "" +msgstr "Incrocio di partenza invalido '%' utilizzato in % di % '%'" #: src/netedit/elements/demand/GNEPlanParents.cpp:124 msgid "Invalid to junction '%' used in % of % '%'" -msgstr "" +msgstr "Incrocio di arrivo invalido '%' utilizzato in % di % '%'" #: src/netedit/elements/demand/GNEPlanParents.cpp:127 msgid "Invalid from TAZ '%' used in % of % '%'" From c41c81b951eaa3fa0991d33b47264321343bde3a Mon Sep 17 00:00:00 2001 From: Mirko Barthauer Date: Tue, 21 Jan 2025 14:37:41 +0000 Subject: [PATCH 047/116] Translated using Weblate (Italian) Currently translated at 94.9% (3479 of 3665 strings) Translation: Eclipse SUMO/SUMO GUI / Netedit Translate-URL: https://hosted.weblate.org/projects/eclipse-sumo/sumo-gui-netedit/it/ --- data/po/it_gui.po | 48 +++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/data/po/it_gui.po b/data/po/it_gui.po index ddf7a2d844ef..03746a899a9e 100644 --- a/data/po/it_gui.po +++ b/data/po/it_gui.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: sumo\n" "Report-Msgid-Bugs-To: sumo-dev@eclipse.org\n" "POT-Creation-Date: 2025-01-02 15:02+0100\n" -"PO-Revision-Date: 2025-01-20 13:51+0000\n" +"PO-Revision-Date: 2025-01-21 14:41+0000\n" "Last-Translator: Mirko Barthauer \n" "Language-Team: Italian \n" @@ -11111,17 +11111,21 @@ msgstr "" msgid "" "id of the travel group. Persons with the same group may share a taxi ride" msgstr "" +"codice identificativo del gruppo di viaggio. Persone dello stesso gruppo " +"possono condividere una corsa di taxi" #: src/netedit/elements/GNEAttributeCarrier.cpp:9501 #: src/netedit/elements/GNEAttributeCarrier.cpp:9554 msgid "" "speed of the person for this tranship in m/s (not together with duration)" msgstr "" +"velocità della persona durante questo trasbordo in m/s (esclude l'uso di " +"duration)" #: src/netedit/elements/GNEAttributeCarrier.cpp:9507 #: src/netedit/elements/GNEAttributeCarrier.cpp:9560 msgid "duration of the plan in second (not together with speed)" -msgstr "" +msgstr "durata del piano in secondi (esclude l'uso di speed)" #: src/netedit/elements/GNEAttributeCarrier.cpp:9520 msgid "list of vehicle alternatives to take for the ride" @@ -11724,6 +11728,8 @@ msgstr "aggiungi ostacolo JuPedSim '" #: src/netedit/elements/demand/GNERouteHandler.cpp:2476 msgid "Could not build % with ID '%' in netedit; % with ID '%' doesn't exist." msgstr "" +"Non è stato possibile creare % con il codice identificativo '%' in netedit " +"perché % con il codice identificativo '%' non esiste." #: src/netedit/elements/additional/GNECalibrator.cpp:216 msgid "Both edges and lanes aren't defined" @@ -11740,6 +11746,8 @@ msgid "" "calibratorFlow of calibrator '%' cannot be written. Either type or " "vehsPerHour or speed must be enabled" msgstr "" +"calibratorFlow del Calibrator '%' non può essere scritto. Uno degli " +"attributi type, vehsPerHour o speed deve essere impostato" #: src/netedit/elements/additional/GNELaneAreaDetector.cpp:168 #: src/netedit/elements/additional/GNEOverheadWire.cpp:127 @@ -11859,7 +11867,7 @@ msgstr "Poligono già semplificato" #: src/netedit/elements/additional/GNEPoly.cpp:528 msgid "Using GEO Shape" -msgstr "" +msgstr "Usando la forma geografica" #: src/netedit/elements/additional/GNERerouter.cpp:104 msgid "' needs at least one edge" @@ -12702,28 +12710,28 @@ msgstr "Seleziona raggiungibili (computa incroci)" #: src/netedit/elements/network/GNENetworkElement.cpp:312 msgid "% (Edited shape)" -msgstr "" +msgstr "% (forma modificata)" #: src/netedit/elements/network/GNENetworkElement.cpp:315 #: src/utils/gui/globjects/GUIGlObject.cpp:278 msgid "Copy test coordinates to clipboard" -msgstr "" +msgstr "Copia coordinate test negli appunti" #: src/netedit/elements/network/GNENetworkElement.cpp:321 msgid "Simplify shape" -msgstr "" +msgstr "Semplifica forma" #: src/netedit/elements/network/GNENetworkElement.cpp:327 msgid "Open junction's shape" -msgstr "" +msgstr "Apri la forma dell'incrocio" #: src/netedit/elements/network/GNENetworkElement.cpp:329 msgid "Close junction's shape" -msgstr "" +msgstr "Chiudi la forma dell'incrocio" #: src/netedit/elements/network/GNENetworkElement.cpp:332 msgid "Straighten shape" -msgstr "" +msgstr "Appiana la forma" #: src/netedit/elements/network/GNENetworkElement.cpp:341 msgid "Remove geometry point (shift+click)" @@ -12765,7 +12773,7 @@ msgstr "" #: src/netedit/frames/GNEAttributesEditor.cpp:153 #, c-format msgid "Open % dialog" -msgstr "" +msgstr "Apri il dialogo %" #: src/netedit/frames/GNEAttributesEditor.cpp:313 #: src/netedit/frames/GNEAttributesEditor.cpp:338 @@ -13724,7 +13732,7 @@ msgstr "Nessun modello di arco definito" #: src/netedit/frames/common/GNEInspectorFrame.cpp:261 msgid "GEO attributes" -msgstr "" +msgstr "Attributi geografici" #: src/netedit/frames/common/GNEMatchAttribute.cpp:47 msgid "Match Attribute" @@ -15318,11 +15326,11 @@ msgstr "" #: src/netedit/frames/network/GNETAZFrame.cpp:499 msgid "New source" -msgstr "" +msgstr "Nuova sorgente" #: src/netedit/frames/network/GNETAZFrame.cpp:504 msgid "New sink" -msgstr "" +msgstr "Nuovo scarico" #: src/netedit/frames/network/GNETAZFrame.cpp:510 msgid "Set zero fringe prob." @@ -15369,7 +15377,7 @@ msgstr "" #: src/netedit/frames/network/GNETAZFrame.cpp:605 msgid "Add " -msgstr "" +msgstr "Aggiungi " #: src/netedit/frames/network/GNETAZFrame.cpp:605 msgid " edges to selection" @@ -15389,12 +15397,12 @@ msgstr "" #: src/netedit/frames/network/GNETAZFrame.cpp:671 msgid "Press ESC to clear the current selection." -msgstr "" +msgstr "Premi ESC per svuotare la selezione attuale." #: src/netedit/frames/network/GNETAZFrame.cpp:848 #: src/netedit/frames/network/GNETAZFrame.cpp:851 msgid "Set weight 0 in " -msgstr "" +msgstr "Imposta il peso 0 in " #: src/netedit/frames/network/GNETAZFrame.cpp:848 #: src/netedit/frames/network/GNETAZFrame.cpp:851 @@ -15998,11 +16006,11 @@ msgstr " ora" #: src/utils/gui/div/GUIMessageWindow.cpp:74 msgid "vehicle" -msgstr "" +msgstr "veicolo" #: src/utils/gui/div/GUIMessageWindow.cpp:75 msgid "person" -msgstr "" +msgstr "persona" #: src/utils/gui/div/GUIMessageWindow.cpp:76 msgid "tlLogic" @@ -16040,11 +16048,11 @@ msgstr "" #: src/utils/gui/div/GUISelectedStorage.cpp:237 #, c-format msgid "% objects ignored, % objects not found\n" -msgstr "" +msgstr "% oggetti ignorati, % oggetti introvabili\n" #: src/utils/gui/div/GUISelectedStorage.cpp:248 msgid "Could not open '%'.\n" -msgstr "" +msgstr "Non ho potuto aprire '%'.\n" #: src/utils/gui/div/GUIVideoEncoder.h:74 msgid "Unknown format!" From 148f8af0f1292f8c72b945b4ea7a12604695cc23 Mon Sep 17 00:00:00 2001 From: Robert Hilbrich Date: Tue, 21 Jan 2025 15:56:44 +0100 Subject: [PATCH 048/116] starting to split the build process, refs #15213 --- tools/build_config/buildMacOSInstaller.py | 148 ++++++++++++---------- 1 file changed, 79 insertions(+), 69 deletions(-) diff --git a/tools/build_config/buildMacOSInstaller.py b/tools/build_config/buildMacOSInstaller.py index 231c768b07fb..af840aa548c1 100755 --- a/tools/build_config/buildMacOSInstaller.py +++ b/tools/build_config/buildMacOSInstaller.py @@ -71,6 +71,8 @@ def parse_args(def_dmg_name, def_pkg_name): op.add_argument("build_dir", help="Build dir of sumo") op.add_argument("--output-pkg", dest="output_pkg", help="Output path for pkg", default=def_output_pkg_path) op.add_argument("--output-dmg", dest="output_dmg", help="Output path for dmg", default=def_output_dmg_path) + op.add_argument("--output-framework-dir", dest="output_framework_dir") + op.add_option("-v", "--verbose", action="store_true", default=False, help="tell me more") return op.parse_args() @@ -169,9 +171,16 @@ def sign_file(file_path): os.remove(temp_entitlements.name) -def create_framework(name, longname, pkg_id, version, sumo_build_directory): +def create_framework(name, longname, pkg_id, version, sumo_build_directory, output_dir=None): print(" - Creating directory structure") - temp_dir = tempfile.mkdtemp() + + # Use the provided framework_dir or create a temporary directory + if output_dir: + if not os.path.exists(output_dir): + os.makedirs(output_dir, exist_ok=True) + temp_dir = output_dir + else: + temp_dir = tempfile.mkdtemp() # Create the directory structure for the framework bundle # see: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html # noqa @@ -285,14 +294,15 @@ def create_framework(name, longname, pkg_id, version, sumo_build_directory): f"/Library/Frameworks/{name}.framework", f"{pkg_path}", ] - print(" - Calling pkgbuild") - subprocess.run(pkg_build_command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - pkg_size = os.path.getsize(pkg_path) + # print(" - Calling pkgbuild") + # subprocess.run(pkg_build_command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + # pkg_size = os.path.getsize(pkg_path) - # Cleanup the temporary directory - print(" - Cleaning up") - shutil.rmtree(temp_dir) - return name, pkg_name, pkg_id, pkg_path, pkg_size + # # Cleanup the temporary directory + # print(" - Cleaning up") + # shutil.rmtree(temp_dir) + # return name, pkg_name, pkg_id, pkg_path, pkg_size + return name, pkg_name, pkg_id, pkg_path, 0 def create_app(app_name, exec_call, framework_name, pkg_id, version, icns_path, verbose): @@ -510,68 +520,68 @@ def main(): # Building the framework package print("Building framework package 'EclipseSUMO'") - framework_pkg = create_framework("EclipseSUMO", "Eclipse SUMO", f"{base_id}.framework", version, opts.build_dir) + framework_pkg = create_framework("EclipseSUMO", "Eclipse SUMO", f"{base_id}.framework", version, opts.build_dir, opts.output_framework_dir) print(f"Successfully built: '{framework_pkg[1]}' ({framework_pkg[4] / (1024 * 1024):.2f} MB)\n") - # Building all the app launchers packages - cwd = os.path.dirname(os.path.abspath(__file__)) - app_pkgs = [] - app_list = [ - ( - "SUMO sumo-gui", - 'exec "$SUMO_HOME/bin/sumo-gui" "$@" &', - framework_pkg[0], - f"{base_id}.apps.sumo-gui", - version, - "sumo-gui.icns", - ), - ( - "SUMO netedit", - 'exec "$SUMO_HOME/bin/netedit" "$@" &', - framework_pkg[0], - f"{base_id}.apps.netedit", - version, - "netedit.icns", - ), - ( - "SUMO Scenario Wizard", - ( - "python $SUMO_HOME/share/sumo/tools/osmWebWizard.py ||" - "python3 $SUMO_HOME/share/sumo/tools/osmWebWizard.py &" - ), - framework_pkg[0], - f"{base_id}.apps.scenario-wizard", - version, - "scenario-wizard.icns", - ), - ] - for app_name, app_binary, app_framework, app_id, app_ver, app_icons in app_list: - print(f"Building app package for '{app_name}'") - - icon_path = os.path.join(cwd, "..", "..", "build_config", "macos", "installer", app_icons) - app_pkg = create_app(app_name, app_binary, app_framework, app_id, app_ver, icon_path, opts.verbose) - app_pkgs.append(app_pkg) - print(f"Successfully built: '{app_pkg[1]}' ({app_pkg[4] / (1024 * 1024):.2f} MB)\n") - - # Building the installer package - print("Building installer") - installer_pkg = create_installer(framework_pkg, app_pkgs, f"{base_id}.installer", version, - opts.output_pkg, opts.verbose) - print("Successfully built installer\n") - - # Putting the installer package into a dmg file - ready for signing - print("Building disk image") - create_dmg("Eclipse SUMO", opts.output_dmg, installer_pkg[3]) - print("Successfully built disk image\n") - - # Removing non-installer pkg-files - os.remove(framework_pkg[3]) - for app_pkg in app_pkgs: - os.remove(app_pkg[3]) - - print("Build completed successfully") - print(f" - disk image : '{opts.output_dmg}' ({os.path.getsize(opts.output_dmg) / (1024 * 1024):.2f} MB)") - print(f" - installer pkg: '{opts.output_pkg}' ({os.path.getsize(opts.output_pkg) / (1024 * 1024):.2f} MB)") + # # Building all the app launchers packages + # cwd = os.path.dirname(os.path.abspath(__file__)) + # app_pkgs = [] + # app_list = [ + # ( + # "SUMO sumo-gui", + # 'exec "$SUMO_HOME/bin/sumo-gui" "$@" &', + # framework_pkg[0], + # f"{base_id}.apps.sumo-gui", + # version, + # "sumo-gui.icns", + # ), + # ( + # "SUMO netedit", + # 'exec "$SUMO_HOME/bin/netedit" "$@" &', + # framework_pkg[0], + # f"{base_id}.apps.netedit", + # version, + # "netedit.icns", + # ), + # ( + # "SUMO Scenario Wizard", + # ( + # "python $SUMO_HOME/share/sumo/tools/osmWebWizard.py ||" + # "python3 $SUMO_HOME/share/sumo/tools/osmWebWizard.py &" + # ), + # framework_pkg[0], + # f"{base_id}.apps.scenario-wizard", + # version, + # "scenario-wizard.icns", + # ), + # ] + # for app_name, app_binary, app_framework, app_id, app_ver, app_icons in app_list: + # print(f"Building app package for '{app_name}'") + + # icon_path = os.path.join(cwd, "..", "..", "build_config", "macos", "installer", app_icons) + # app_pkg = create_app(app_name, app_binary, app_framework, app_id, app_ver, icon_path, opts.verbose) + # app_pkgs.append(app_pkg) + # print(f"Successfully built: '{app_pkg[1]}' ({app_pkg[4] / (1024 * 1024):.2f} MB)\n") + + # # Building the installer package + # print("Building installer") + # installer_pkg = create_installer(framework_pkg, app_pkgs, f"{base_id}.installer", version, + # opts.output_pkg, opts.verbose) + # print("Successfully built installer\n") + + # # Putting the installer package into a dmg file - ready for signing + # print("Building disk image") + # create_dmg("Eclipse SUMO", opts.output_dmg, installer_pkg[3]) + # print("Successfully built disk image\n") + + # # Removing non-installer pkg-files + # os.remove(framework_pkg[3]) + # for app_pkg in app_pkgs: + # os.remove(app_pkg[3]) + + # print("Build completed successfully") + # print(f" - disk image : '{opts.output_dmg}' ({os.path.getsize(opts.output_dmg) / (1024 * 1024):.2f} MB)") + # print(f" - installer pkg: '{opts.output_pkg}' ({os.path.getsize(opts.output_pkg) / (1024 * 1024):.2f} MB)") if __name__ == "__main__": From e167b940b5dc242a99c542bf7b3def45f07ef981 Mon Sep 17 00:00:00 2001 From: Michael Behrisch Date: Tue, 21 Jan 2025 16:05:39 +0100 Subject: [PATCH 049/116] Adding Scenario, thanks Miguel Sepulcre #2 --- docs/web/docs/Data/Scenarios.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/web/docs/Data/Scenarios.md b/docs/web/docs/Data/Scenarios.md index a7c0d2ed49e4..047a3d2e66d3 100644 --- a/docs/web/docs/Data/Scenarios.md +++ b/docs/web/docs/Data/Scenarios.md @@ -8,6 +8,11 @@ Building a scenario is a lot of work. If you have built a SUMO scenario you can share (under a sufficiently open license), please [contact us](../Contact.md). +# Alicante-Murcia highway scenario +Large-scale and high-accuracy traffic simulation scenario that models 9 full days of traffic over a 97 km freeway section, with mixed traffic (light and heavy vehicles). The simulation scenario has been calibrated using a unique dataset provided by the Spanish road authority and a novel learning-based and iterative traffic demand calibration technique for SUMO. + +More info at: https://github.com/msepulcre/Alicante-Murcia-SUMO-Scenario + # Berlin - [Mosaic Berlin Sumo Traffic (BeST) Scenario on GitHub](https://github.com/mosaic-addons/best-scenario) From 790192c4d28ba4d88d4b8935b80b2040dd786335 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:37:52 +0000 Subject: [PATCH 050/116] Bump dieghernan/cff-validator from 3 to 4 Bumps [dieghernan/cff-validator](https://github.com/dieghernan/cff-validator) from 3 to 4. - [Release notes](https://github.com/dieghernan/cff-validator/releases) - [Changelog](https://github.com/dieghernan/cff-validator/blob/main/CHANGELOG.md) - [Commits](https://github.com/dieghernan/cff-validator/compare/v3...v4) --- updated-dependencies: - dependency-name: dieghernan/cff-validator dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 14fe95408087..855e8e462424 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -46,7 +46,7 @@ jobs: - name: Validate CITATION.cff if: matrix.build_type == 'full' && github.event_name == 'schedule' && matrix.compiler == 'gcc' - uses: dieghernan/cff-validator@v3 + uses: dieghernan/cff-validator@v4 with: install-r: true citation-path: sumo/CITATION.cff From 3ee7a6d00329770726ba7385f66937e8538144f0 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 14:16:24 +0100 Subject: [PATCH 051/116] Added GNEHierarchicalContainerChildrenHash.h. Refs #16039 --- src/netedit/elements/CMakeLists.txt | 1 + .../GNEHierarchicalContainerChildrenHash.h | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/netedit/elements/GNEHierarchicalContainerChildrenHash.h diff --git a/src/netedit/elements/CMakeLists.txt b/src/netedit/elements/CMakeLists.txt index 7afbaa6c47c1..c1975da0b3b3 100644 --- a/src/netedit/elements/CMakeLists.txt +++ b/src/netedit/elements/CMakeLists.txt @@ -16,6 +16,7 @@ set(netedit_elements_SRCS GNEGeneralHandler.h GNEHierarchicalContainerParents.h GNEHierarchicalContainerChildren.h + GNEHierarchicalContainerChildrenHash GNEHierarchicalElement.cpp GNEHierarchicalElement.h GNEHierarchicalStructure.cpp diff --git a/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h b/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h new file mode 100644 index 000000000000..157f8c5f5ac1 --- /dev/null +++ b/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h @@ -0,0 +1,41 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo +// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0/ +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License 2.0 are satisfied: GNU General Public License, version 2 +// or later which is available at +// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later +/****************************************************************************/ +/// @file GNEHierarchicalContainerChildrenHash.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2025 +/// +// Template container for GNEHierarchical elements +/****************************************************************************/ +#pragma once +#include + +#include + +// =========================================================================== +// class definitions +// =========================================================================== + +template +class GNEHierarchicalContainerChildrenHash : public std::unordered_set { + +public: + /// @brief default constructor + GNEHierarchicalContainerChildren() { + } + + /// @brief parameter constructor + GNEHierarchicalContainerChildren(const std::unordered_set& elements) : + std::unordered_set(elements) { + } +}; From 831209b6116c1e9d8f071ad4d1594885c9f726fb Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 15:19:34 +0100 Subject: [PATCH 052/116] Updated GNEHierarchicalStructure. Refs #16039 --- .../GNEHierarchicalContainerChildrenHash.h | 4 +-- .../elements/GNEHierarchicalStructure.cpp | 30 +++++++++++++++++++ .../elements/GNEHierarchicalStructure.h | 17 +++++++++-- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h b/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h index 157f8c5f5ac1..484cfcc74c81 100644 --- a/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h +++ b/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h @@ -31,11 +31,11 @@ class GNEHierarchicalContainerChildrenHash : public std::unordered_set { public: /// @brief default constructor - GNEHierarchicalContainerChildren() { + GNEHierarchicalContainerChildrenHash() { } /// @brief parameter constructor - GNEHierarchicalContainerChildren(const std::unordered_set& elements) : + GNEHierarchicalContainerChildrenHash(const std::unordered_set& elements) : std::unordered_set(elements) { } }; diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index 186ad8467573..484024531791 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,7 @@ GNEHierarchicalStructure::getContainerSize() const { myChildEdges.size() + myChildLanes.size() + myChildAdditionals.size() + + myChildSourceSinks.size() + myChildDemandElements.size() + myChildGenericDatas.size() ); @@ -196,6 +198,12 @@ GNEHierarchicalStructure::addChildElement(GNEAdditional* additional) { } +template <> void +GNEHierarchicalStructure::addChildElement(GNETAZSourceSink* TAZSourceSink) { + myChildSourceSinks.insert(TAZSourceSink); +} + + template <> void GNEHierarchicalStructure::addChildElement(GNEDemandElement* demandElement) { myChildDemandElements.push_back(demandElement); @@ -253,6 +261,16 @@ GNEHierarchicalStructure::removeChildElement(GNEAdditional* additional) { } +template <> void +GNEHierarchicalStructure::removeChildElement(GNETAZSourceSink* TAZSourceSink) { + auto it = myChildSourceSinks.find(TAZSourceSink); + if (it != myChildSourceSinks.end()) { + myChildSourceSinks.erase(it); + } else { + throw ProcessError(TAZSourceSink->getTagStr() + " is not a child element"); + } +} + template <> void GNEHierarchicalStructure::removeChildElement(GNEDemandElement* demandElement) { auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); @@ -371,6 +389,12 @@ GNEHierarchicalStructure::getChildren() const { } +template<> const GNEHierarchicalContainerChildrenHash& +GNEHierarchicalStructure::getChildrenHash() const { + return myChildSourceSinks; +} + + template<> const GNEHierarchicalContainerChildren& GNEHierarchicalStructure::getChildren() const { return myChildDemandElements; @@ -407,6 +431,12 @@ GNEHierarchicalStructure::setChildren(const std::vector& newChil } +template<> void +GNEHierarchicalStructure::setChildren(const std::unordered_set& newChildren) { + myChildSourceSinks = newChildren; +} + + template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { myChildDemandElements = newChildren; diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index 3d571c7efffc..4b36e820a07d 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -24,6 +24,7 @@ #include "GNEHierarchicalContainerParents.h" #include "GNEHierarchicalContainerChildren.h" +#include "GNEHierarchicalContainerChildrenHash.h" // =========================================================================== // class declarations @@ -34,6 +35,7 @@ class GNEJunction; class GNEEdge; class GNELane; class GNEAdditional; +class GNETAZSourceSink; class GNEDemandElement; class GNEGenericData; class GNEHierarchicalElement; @@ -83,15 +85,23 @@ class GNEHierarchicalStructure { /// @brief set parents template - void setParents(const T& newParents); + void setParents(const std::vector& newParents); /// @brief get children template const GNEHierarchicalContainerChildren& getChildren() const; + /// @brief get children (hash) + template + const GNEHierarchicalContainerChildrenHash& getChildrenHash() const; + /// @brief set children template - void setChildren(const T& newChildren); + void setChildren(const std::vector& newChildren); + + /// @brief set children (Hash) + template + void setChildren(const std::unordered_set& newChildren); private: /// @brief parents junctions @@ -124,6 +134,9 @@ class GNEHierarchicalStructure { /// @brief children additional elements GNEHierarchicalContainerChildren myChildAdditionals; + /// @brief children additional elements + GNEHierarchicalContainerChildrenHash myChildSourceSinks; + /// @brief children demand elements GNEHierarchicalContainerChildren myChildDemandElements; From 57ef295ace795372daca4edb49a441ff12744953 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 16:07:20 +0100 Subject: [PATCH 053/116] Added GNEChange_TAZSourceSink. Refs #16039 --- src/netedit/GNENetHelper.h | 1 + src/netedit/changes/CMakeLists.txt | 2 + src/netedit/changes/GNEChange.h | 24 +-- .../changes/GNEChange_TAZSourceSink.cpp | 140 ++++++++++++++++++ src/netedit/changes/GNEChange_TAZSourceSink.h | 66 +++++++++ .../elements/GNEHierarchicalElement.cpp | 6 + src/netedit/elements/GNEHierarchicalElement.h | 3 + .../elements/GNEHierarchicalStructure.cpp | 44 +++++- .../elements/GNEHierarchicalStructure.h | 13 +- 9 files changed, 274 insertions(+), 25 deletions(-) create mode 100644 src/netedit/changes/GNEChange_TAZSourceSink.cpp create mode 100644 src/netedit/changes/GNEChange_TAZSourceSink.h diff --git a/src/netedit/GNENetHelper.h b/src/netedit/GNENetHelper.h index 42da9aa22d30..5a4f06538954 100644 --- a/src/netedit/GNENetHelper.h +++ b/src/netedit/GNENetHelper.h @@ -88,6 +88,7 @@ struct GNENetHelper { friend class GNEChange_Junction; friend class GNEChange_EdgeType; friend class GNEChange_Edge; + friend class GNEChange_TAZSourceSink; friend class GNEChange_Additional; friend class GNEChange_Shape; friend class GNEChange_TAZElement; diff --git a/src/netedit/changes/CMakeLists.txt b/src/netedit/changes/CMakeLists.txt index 4d25ae3a1bbe..f7a9c4904177 100644 --- a/src/netedit/changes/CMakeLists.txt +++ b/src/netedit/changes/CMakeLists.txt @@ -33,6 +33,8 @@ set(netedit_changes_SRCS GNEChange_Lane.h GNEChange_MeanData.cpp GNEChange_MeanData.h + GNEChange_TAZSourceSink.cpp + GNEChange_TAZSourceSink.h GNEChange_TLS.cpp GNEChange_TLS.h GNEChange_ToggleAttribute.cpp diff --git a/src/netedit/changes/GNEChange.h b/src/netedit/changes/GNEChange.h index 8efa36c7b7cb..38321d1ff5c6 100644 --- a/src/netedit/changes/GNEChange.h +++ b/src/netedit/changes/GNEChange.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -132,8 +132,8 @@ class GNEChange : public FXObject { for (const auto& lane : myOriginalHierarchicalContainer.getParents()) { lane->addChildElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getParents()) { - additional->addChildElement(element); + for (const auto& sourceSink : myOriginalHierarchicalContainer.getParents()) { + sourceSink->addChildElement(element); } for (const auto& demandElement : myOriginalHierarchicalContainer.getParents()) { demandElement->addChildElement(element); @@ -151,8 +151,11 @@ class GNEChange : public FXObject { for (const auto& lane : myOriginalHierarchicalContainer.getChildren()) { lane->addParentElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getChildren()) { - additional->addParentElement(element); + for (const auto& sourceSink : myOriginalHierarchicalContainer.getChildren()) { + sourceSink->addParentElement(element); + } + for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildren()) { + TAZSourceSink->addParentElement(element); } for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren()) { demandElement->addParentElement(element); @@ -175,8 +178,8 @@ class GNEChange : public FXObject { for (const auto& lane : myOriginalHierarchicalContainer.getParents()) { lane->removeChildElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getParents()) { - additional->removeChildElement(element); + for (const auto& sourceSink : myOriginalHierarchicalContainer.getParents()) { + sourceSink->removeChildElement(element); } for (const auto& demandElement : myOriginalHierarchicalContainer.getParents()) { demandElement->removeChildElement(element); @@ -194,8 +197,11 @@ class GNEChange : public FXObject { for (const auto& lane : myOriginalHierarchicalContainer.getChildren()) { lane->removeParentElement(element); } - for (const auto& additional : myOriginalHierarchicalContainer.getChildren()) { - additional->removeParentElement(element); + for (const auto& sourceSink : myOriginalHierarchicalContainer.getChildren()) { + sourceSink->removeParentElement(element); + } + for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildren()) { + TAZSourceSink->removeParentElement(element); } for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren()) { demandElement->removeParentElement(element); diff --git a/src/netedit/changes/GNEChange_TAZSourceSink.cpp b/src/netedit/changes/GNEChange_TAZSourceSink.cpp new file mode 100644 index 000000000000..caeeb85fccb4 --- /dev/null +++ b/src/netedit/changes/GNEChange_TAZSourceSink.cpp @@ -0,0 +1,140 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo +// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0/ +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License 2.0 are satisfied: GNU General Public License, version 2 +// or later which is available at +// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later +/****************************************************************************/ +/// @file GNEChange_TAZSourceSink.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// A network change in which a busStop is created or deleted +/****************************************************************************/ +#include + +#include +#include +#include +#include + +#include "GNEChange_TAZSourceSink.h" + +// =========================================================================== +// FOX-declarations +// =========================================================================== +FXIMPLEMENT_ABSTRACT(GNEChange_TAZSourceSink, GNEChange, nullptr, 0) + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEChange_TAZSourceSink::GNEChange_TAZSourceSink(GNETAZSourceSink* sourceSink, bool forward) : + GNEChange(Supermode::NETWORK, sourceSink, forward, sourceSink->isAttributeCarrierSelected()), + mySourceSink(sourceSink) { + mySourceSink->incRef("GNEChange_TAZSourceSink"); +} + + +GNEChange_TAZSourceSink::~GNEChange_TAZSourceSink() { + // only continue we have undo-redo mode enabled + if (mySourceSink->getNet()->getViewNet()->getViewParent()->getGNEAppWindows()->isUndoRedoAllowed()) { + mySourceSink->decRef("GNEChange_TAZSourceSink"); + if (mySourceSink->unreferenced()) { + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + mySourceSink->getTagStr()); + // make sure that sourceSink isn't in net before removing + if (mySourceSink->getNet()->getAttributeCarriers()->retrieveAdditional(mySourceSink, false)) { + // delete sourceSink from net + mySourceSink->getNet()->getAttributeCarriers()->deleteAdditional(mySourceSink); + } + delete mySourceSink; + } + } +} + + +void +GNEChange_TAZSourceSink::undo() { + if (myForward) { + // show extra information for tests + WRITE_DEBUG("Removing " + mySourceSink->getTagStr() + " '" + mySourceSink->getID() + "' in GNEChange_TAZSourceSink"); + // unselect if mySelectedElement is enabled + if (mySelectedElement) { + mySourceSink->unselectAttributeCarrier(); + } + // delete sourceSink from net + mySourceSink->getNet()->getAttributeCarriers()->deleteAdditional(mySourceSink); + // restore container + restoreHierarchicalContainers(); + } else { + // show extra information for tests + WRITE_DEBUG("Adding " + mySourceSink->getTagStr() + " '" + mySourceSink->getID() + "' in GNEChange_TAZSourceSink"); + // select if mySelectedElement is enabled + if (mySelectedElement) { + mySourceSink->selectAttributeCarrier(); + } + // insert sourceSink into net + mySourceSink->getNet()->getAttributeCarriers()->insertAdditional(mySourceSink); + // restore container + restoreHierarchicalContainers(); + } + // require always save sourceSinks + mySourceSink->getNet()->getSavingStatus()->requireSaveAdditionals(); +} + + +void +GNEChange_TAZSourceSink::redo() { + if (myForward) { + // show extra information for tests + WRITE_DEBUG("Adding " + mySourceSink->getTagStr() + " '" + mySourceSink->getID() + "' in GNEChange_TAZSourceSink"); + // select if mySelectedElement is enabled + if (mySelectedElement) { + mySourceSink->selectAttributeCarrier(); + } + // insert sourceSink into net + mySourceSink->getNet()->getAttributeCarriers()->insertAdditional(mySourceSink); + // add sourceSink in parent elements + addElementInParentsAndChildren(mySourceSink); + } else { + // show extra information for tests + WRITE_DEBUG("Removing " + mySourceSink->getTagStr() + " '" + mySourceSink->getID() + "' in GNEChange_TAZSourceSink"); + // unselect if mySelectedElement is enabled + if (mySelectedElement) { + mySourceSink->unselectAttributeCarrier(); + } + // delete sourceSink from net + mySourceSink->getNet()->getAttributeCarriers()->deleteAdditional(mySourceSink); + // remove sourceSink from parents and children + removeElementFromParentsAndChildren(mySourceSink); + } + // require always save sourceSinks + mySourceSink->getNet()->getSavingStatus()->requireSaveAdditionals(); +} + + +std::string +GNEChange_TAZSourceSink::undoName() const { + if (myForward) { + return (TL("Undo create ") + mySourceSink->getTagStr() + " '" + mySourceSink->getID() + "'"); + } else { + return (TL("Undo delete ") + mySourceSink->getTagStr() + " '" + mySourceSink->getID() + "'"); + } +} + + +std::string +GNEChange_TAZSourceSink::redoName() const { + if (myForward) { + return (TL("Redo create ") + mySourceSink->getTagStr() + " '" + mySourceSink->getID() + "'"); + } else { + return (TL("Redo delete ") + mySourceSink->getTagStr() + " '" + mySourceSink->getID() + "'"); + } +} diff --git a/src/netedit/changes/GNEChange_TAZSourceSink.h b/src/netedit/changes/GNEChange_TAZSourceSink.h new file mode 100644 index 000000000000..9251c2df42a8 --- /dev/null +++ b/src/netedit/changes/GNEChange_TAZSourceSink.h @@ -0,0 +1,66 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo +// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0/ +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License 2.0 are satisfied: GNU General Public License, version 2 +// or later which is available at +// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later +/****************************************************************************/ +/// @file GNEChange_TAZSourceSink.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2025 +/// +// A network change in which a TAZ SourceSink element is created or deleted +/****************************************************************************/ +#pragma once +#include + +#include "GNEChange.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEChange_TAZSourceSink + * A network change in which a sourceSink element is created or deleted + */ +class GNEChange_TAZSourceSink : public GNEChange { + FXDECLARE_ABSTRACT(GNEChange_TAZSourceSink) + +public: + /**@brief Constructor for creating/deleting an sourceSink element + * @param[in] sourceSink The sourceSink element to be created/deleted + * @param[in] forward Whether to create/delete (true/false) + */ + GNEChange_TAZSourceSink(GNETAZSourceSink* sourceSink, bool forward); + + /// @brief Destructor + ~GNEChange_TAZSourceSink(); + + /// @name inherited from GNEChange + /// @{ + /// @brief get undo Name + std::string undoName() const; + + /// @brief get Redo name + std::string redoName() const; + + /// @brief undo action + void undo(); + + /// @brief redo action + void redo(); + /// @} + +private: + /**@brief full information regarding the sourceSink element that is to be created/deleted + * @note we assume shared responsibility for the pointer (via reference counting) + */ + GNETAZSourceSink* mySourceSink; +}; diff --git a/src/netedit/elements/GNEHierarchicalElement.cpp b/src/netedit/elements/GNEHierarchicalElement.cpp index 86e72b6be1cd..01ab272dba21 100644 --- a/src/netedit/elements/GNEHierarchicalElement.cpp +++ b/src/netedit/elements/GNEHierarchicalElement.cpp @@ -191,6 +191,12 @@ GNEHierarchicalElement::getChildAdditionals() const { } +const GNEHierarchicalContainerChildren& +GNEHierarchicalElement::getChildTAZSourceSinks() const { + return myHierarchicalStructure.getChildren(); +} + + const GNEHierarchicalContainerChildren& GNEHierarchicalElement::getChildDemandElements() const { return myHierarchicalStructure.getChildren(); diff --git a/src/netedit/elements/GNEHierarchicalElement.h b/src/netedit/elements/GNEHierarchicalElement.h index 2b5f0457f6db..4ec84fe9f472 100644 --- a/src/netedit/elements/GNEHierarchicalElement.h +++ b/src/netedit/elements/GNEHierarchicalElement.h @@ -124,6 +124,9 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { /// @brief return child additionals const GNEHierarchicalContainerChildren& getChildAdditionals() const; + /// @brief return child TAZSourceSinks + const GNEHierarchicalContainerChildren& getChildTAZSourceSinks() const; + /// @brief return child demand elements const GNEHierarchicalContainerChildren& getChildDemandElements() const; diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index 484024531791..f7b8053435fe 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -59,6 +59,7 @@ GNEHierarchicalStructure::getContainerSize() const { myParentEdges.size() + myParentLanes.size() + myParentAdditionals.size() + + myParentTAZSourceSinks.size() + myParentDemandElements.size() + myParentGenericDatas.size() + myChildJunctions.size() + @@ -96,6 +97,12 @@ GNEHierarchicalStructure::addParentElement(GNEAdditional* additional) { } +template <> void +GNEHierarchicalStructure::addParentElement(GNETAZSourceSink* TAZSourceSink) { + myParentTAZSourceSinks.push_back(TAZSourceSink); +} + + template <> void GNEHierarchicalStructure::addParentElement(GNEDemandElement* demandElement) { myParentDemandElements.push_back(demandElement); @@ -142,10 +149,21 @@ GNEHierarchicalStructure::removeParentElement(GNELane* lane) { template <> void -GNEHierarchicalStructure::removeParentElement(GNEAdditional* additional) { - auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional); +GNEHierarchicalStructure::removeParentElement(GNETAZSourceSink* TAZSourceSink) { + auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), TAZSourceSink); if (it != myParentAdditionals.end()) { myParentAdditionals.erase(it); + } else { + throw ProcessError(TAZSourceSink->getTagStr() + " with ID='" + TAZSourceSink->getID() + "' is not a parent element"); + } +} + + +template <> void +GNEHierarchicalStructure::removeParentElement(GNEAdditional* additional) { + auto it = std::find(myParentTAZSourceSinks.begin(), myParentTAZSourceSinks.end(), additional); + if (it != myParentTAZSourceSinks.end()) { + myParentTAZSourceSinks.erase(it); } else { throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' is not a parent element"); } @@ -200,7 +218,7 @@ GNEHierarchicalStructure::addChildElement(GNEAdditional* additional) { template <> void GNEHierarchicalStructure::addChildElement(GNETAZSourceSink* TAZSourceSink) { - myChildSourceSinks.insert(TAZSourceSink); + myChildSourceSinks.push_back(TAZSourceSink); } @@ -263,7 +281,7 @@ GNEHierarchicalStructure::removeChildElement(GNEAdditional* additional) { template <> void GNEHierarchicalStructure::removeChildElement(GNETAZSourceSink* TAZSourceSink) { - auto it = myChildSourceSinks.find(TAZSourceSink); + auto it = std::find(myChildSourceSinks.begin(), myChildSourceSinks.end(), TAZSourceSink); if (it != myChildSourceSinks.end()) { myChildSourceSinks.erase(it); } else { @@ -317,6 +335,12 @@ GNEHierarchicalStructure::getParents() const { } +template<> const GNEHierarchicalContainerParents& +GNEHierarchicalStructure::getParents() const { + return myParentTAZSourceSinks; +} + + template<> const GNEHierarchicalContainerParents& GNEHierarchicalStructure::getParents() const { return myParentDemandElements; @@ -353,6 +377,12 @@ GNEHierarchicalStructure::setParents(const std::vector& newParen } +template<> void +GNEHierarchicalStructure::setParents(const std::vector& newParents) { + myParentTAZSourceSinks = newParents; +} + + template<> void GNEHierarchicalStructure::setParents(const std::vector& newParents) { myParentDemandElements = newParents; @@ -389,8 +419,8 @@ GNEHierarchicalStructure::getChildren() const { } -template<> const GNEHierarchicalContainerChildrenHash& -GNEHierarchicalStructure::getChildrenHash() const { +template<> const GNEHierarchicalContainerChildren& +GNEHierarchicalStructure::getChildren() const { return myChildSourceSinks; } @@ -432,7 +462,7 @@ GNEHierarchicalStructure::setChildren(const std::vector& newChil template<> void -GNEHierarchicalStructure::setChildren(const std::unordered_set& newChildren) { +GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { myChildSourceSinks = newChildren; } diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index 4b36e820a07d..b623114d3590 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -91,18 +91,10 @@ class GNEHierarchicalStructure { template const GNEHierarchicalContainerChildren& getChildren() const; - /// @brief get children (hash) - template - const GNEHierarchicalContainerChildrenHash& getChildrenHash() const; - /// @brief set children template void setChildren(const std::vector& newChildren); - /// @brief set children (Hash) - template - void setChildren(const std::unordered_set& newChildren); - private: /// @brief parents junctions GNEHierarchicalContainerParents myParentJunctions; @@ -116,6 +108,9 @@ class GNEHierarchicalStructure { /// @brief parents additionals GNEHierarchicalContainerParents myParentAdditionals; + /// @brief parents additionals + GNEHierarchicalContainerParents myParentTAZSourceSinks; + /// @brief parents demand elements GNEHierarchicalContainerParents myParentDemandElements; @@ -135,7 +130,7 @@ class GNEHierarchicalStructure { GNEHierarchicalContainerChildren myChildAdditionals; /// @brief children additional elements - GNEHierarchicalContainerChildrenHash myChildSourceSinks; + GNEHierarchicalContainerChildren myChildSourceSinks; /// @brief children demand elements GNEHierarchicalContainerChildren myChildDemandElements; From 02e89bc1ca60dacd86a01eba7f22f254a11c59e0 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 16:28:13 +0100 Subject: [PATCH 054/116] Now netedit uses GNEChange_TAZSourceSink. Refs #16039 --- .../elements/GNEHierarchicalStructure.cpp | 1 - .../additional/GNEAdditionalHandler.cpp | 41 ++++++++++--------- src/netedit/frames/network/GNETAZFrame.cpp | 18 ++++---- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index f7b8053435fe..73ad5e682dd2 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -225,7 +225,6 @@ GNEHierarchicalStructure::addChildElement(GNETAZSourceSink* TAZSourceSink) { template <> void GNEHierarchicalStructure::addChildElement(GNEDemandElement* demandElement) { myChildDemandElements.push_back(demandElement); - } diff --git a/src/netedit/elements/additional/GNEAdditionalHandler.cpp b/src/netedit/elements/additional/GNEAdditionalHandler.cpp index 8e9ea65427c3..c99cce783a8d 100644 --- a/src/netedit/elements/additional/GNEAdditionalHandler.cpp +++ b/src/netedit/elements/additional/GNEAdditionalHandler.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -1356,11 +1357,11 @@ GNEAdditionalHandler::buildTAZ(const CommonXMLStructure::SumoBaseObject* sumoBas // create TAZEdges for (const auto& edge : edges) { // create TAZ Source using GNEChange_Additional - GNEAdditional* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, 1); - myNet->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); + GNETAZSourceSink* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, 1); + myNet->getViewNet()->getUndoList()->add(new GNEChange_TAZSourceSink(TAZSource, true), true); // create TAZ Sink using GNEChange_Additional - GNEAdditional* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, 1); - myNet->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); + GNETAZSourceSink* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, 1); + myNet->getViewNet()->getUndoList()->add(new GNEChange_TAZSourceSink(TAZSink, true), true); } myNet->getViewNet()->getUndoList()->end(); } else { @@ -1400,21 +1401,21 @@ GNEAdditionalHandler::buildTAZSource(const CommonXMLStructure::SumoBaseObject* s return writeErrorInvalidParent(SUMO_TAG_SOURCE, edgeID, SUMO_TAG_EDGE, TAZ->getID()); } else { // declare TAZ Source - GNEAdditional* TAZSource = nullptr; + GNEAdditional* existentTAZSource = nullptr; // first check if already exist a TAZ Source for the given edge and TAZ - for (auto it = edge->getChildAdditionals().begin(); (it != edge->getChildAdditionals().end()) && !TAZSource; it++) { + for (auto it = edge->getChildAdditionals().begin(); (it != edge->getChildAdditionals().end()) && !existentTAZSource; it++) { if (((*it)->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) && ((*it)->getParentAdditionals().front() == TAZ)) { - TAZSource = (*it); + existentTAZSource = (*it); } } // check if TAZSource has to be created - if (TAZSource == nullptr) { + if (existentTAZSource == nullptr) { // Create TAZ only with departWeight - TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, departWeight); + GNETAZSourceSink* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, departWeight); // add it depending of allow undoRed if (myAllowUndoRedo) { myNet->getViewNet()->getUndoList()->begin(TAZ, TL("add TAZ Source in '") + TAZ->getID() + "'"); - myNet->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); + myNet->getViewNet()->getUndoList()->add(new GNEChange_TAZSourceSink(TAZSource, true), true); myNet->getViewNet()->getUndoList()->end(); } else { myNet->getAttributeCarriers()->insertAdditional(TAZSource); @@ -1425,10 +1426,10 @@ GNEAdditionalHandler::buildTAZSource(const CommonXMLStructure::SumoBaseObject* s // update TAZ Attribute depending of allow undoRed if (myAllowUndoRedo) { myNet->getViewNet()->getUndoList()->begin(TAZ, TL("update TAZ Source in '") + TAZ->getID() + "'"); - TAZSource->setAttribute(SUMO_ATTR_WEIGHT, toString(departWeight), myNet->getViewNet()->getUndoList()); + existentTAZSource->setAttribute(SUMO_ATTR_WEIGHT, toString(departWeight), myNet->getViewNet()->getUndoList()); myNet->getViewNet()->getUndoList()->end(); } else { - TAZSource->setAttribute(SUMO_ATTR_WEIGHT, toString(departWeight), nullptr); + existentTAZSource->setAttribute(SUMO_ATTR_WEIGHT, toString(departWeight), nullptr); } } return true; @@ -1449,21 +1450,21 @@ GNEAdditionalHandler::buildTAZSink(const CommonXMLStructure::SumoBaseObject* sum return writeErrorInvalidParent(SUMO_TAG_SOURCE, edgeID, SUMO_TAG_EDGE, TAZ->getID()); } else { // declare TAZ Sink - GNEAdditional* TAZSink = nullptr; + GNEAdditional* existentTAZSink = nullptr; // first check if already exist a TAZ Sink for the given edge and TAZ - for (auto it = edge->getChildAdditionals().begin(); (it != edge->getChildAdditionals().end()) && !TAZSink; it++) { + for (auto it = edge->getChildAdditionals().begin(); (it != edge->getChildAdditionals().end()) && !existentTAZSink; it++) { if (((*it)->getTagProperty().getTag() == SUMO_TAG_TAZSINK) && ((*it)->getParentAdditionals().front() == TAZ)) { - TAZSink = (*it); + existentTAZSink = (*it); } } // check if TAZSink has to be created - if (TAZSink == nullptr) { + if (existentTAZSink == nullptr) { // Create TAZ only with departWeight - TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, arrivalWeight); + GNETAZSourceSink* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, arrivalWeight); // add it depending of allow undoRed if (myAllowUndoRedo) { myNet->getViewNet()->getUndoList()->begin(TAZ, TL("add TAZ Sink in '") + TAZ->getID() + "'"); - myNet->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); + myNet->getViewNet()->getUndoList()->add(new GNEChange_TAZSourceSink(TAZSink, true), true); myNet->getViewNet()->getUndoList()->end(); } else { myNet->getAttributeCarriers()->insertAdditional(TAZSink); @@ -1474,10 +1475,10 @@ GNEAdditionalHandler::buildTAZSink(const CommonXMLStructure::SumoBaseObject* sum // update TAZ Attribute depending of allow undoRed if (myAllowUndoRedo) { myNet->getViewNet()->getUndoList()->begin(TAZ, TL("update TAZ Sink in '") + TAZ->getID() + "'"); - TAZSink->setAttribute(SUMO_ATTR_WEIGHT, toString(arrivalWeight), myNet->getViewNet()->getUndoList()); + existentTAZSink->setAttribute(SUMO_ATTR_WEIGHT, toString(arrivalWeight), myNet->getViewNet()->getUndoList()); myNet->getViewNet()->getUndoList()->end(); } else { - TAZSink->setAttribute(SUMO_ATTR_WEIGHT, toString(arrivalWeight), nullptr); + existentTAZSink->setAttribute(SUMO_ATTR_WEIGHT, toString(arrivalWeight), nullptr); } } return true; diff --git a/src/netedit/frames/network/GNETAZFrame.cpp b/src/netedit/frames/network/GNETAZFrame.cpp index ec00e04f4fd4..97e1cb9c5eb0 100644 --- a/src/netedit/frames/network/GNETAZFrame.cpp +++ b/src/netedit/frames/network/GNETAZFrame.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -1671,10 +1671,10 @@ GNETAZFrame::addOrRemoveTAZMember(GNEEdge* edge) { myTAZSaveChanges->enableButtonsAndBeginUndoList(); // remove Source and Sinks using GNEChange_TAZElement if (myViewNet->getNet()->getAttributeCarriers()->retrieveAdditional(TAZEdgeColor.source->getGUIGlObject(), false)) { - myViewNet->getUndoList()->add(new GNEChange_Additional(TAZEdgeColor.source, false), true); + myViewNet->getUndoList()->add(new GNEChange_TAZSourceSink(TAZEdgeColor.source, false), true); } if (myViewNet->getNet()->getAttributeCarriers()->retrieveAdditional(TAZEdgeColor.sink->getGUIGlObject(), false)) { - myViewNet->getUndoList()->add(new GNEChange_Additional(TAZEdgeColor.sink, false), true); + myViewNet->getUndoList()->add(new GNEChange_TAZSourceSink(TAZEdgeColor.sink, false), true); } // always refresh TAZ Edges after removing TAZSources/Sinks myCurrentTAZ->refreshTAZEdges(); @@ -1686,11 +1686,11 @@ GNETAZFrame::addOrRemoveTAZMember(GNEEdge* edge) { // if wasn't found, then add it myTAZSaveChanges->enableButtonsAndBeginUndoList(); // create TAZ Sink using GNEChange_TAZElement and value of TAZChild default parameters - GNEAdditional* source = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, myCurrentTAZ->getTAZ(), edge, myTAZChildDefaultParameters->getDefaultTAZSourceWeight()); - myViewNet->getUndoList()->add(new GNEChange_Additional(source, true), true); + GNETAZSourceSink* source = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, myCurrentTAZ->getTAZ(), edge, myTAZChildDefaultParameters->getDefaultTAZSourceWeight()); + myViewNet->getUndoList()->add(new GNEChange_TAZSourceSink(source, true), true); // create TAZ Sink using GNEChange_TAZElement and value of TAZChild default parameters - GNEAdditional* sink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, myCurrentTAZ->getTAZ(), edge, myTAZChildDefaultParameters->getDefaultTAZSinkWeight()); - myViewNet->getUndoList()->add(new GNEChange_Additional(sink, true), true); + GNETAZSourceSink* sink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, myCurrentTAZ->getTAZ(), edge, myTAZChildDefaultParameters->getDefaultTAZSinkWeight()); + myViewNet->getUndoList()->add(new GNEChange_TAZSourceSink(sink, true), true); // always refresh TAZ Edges after adding TAZSources/Sinks myCurrentTAZ->refreshTAZEdges(); // update selected button @@ -1710,10 +1710,10 @@ GNETAZFrame::dropTAZMembers() { myTAZSaveChanges->enableButtonsAndBeginUndoList(); // remove Source and Sinks using GNEChange_TAZElement if (myViewNet->getNet()->getAttributeCarriers()->retrieveAdditional(TAZEdgeColor.source, false)) { - myViewNet->getUndoList()->add(new GNEChange_Additional(TAZEdgeColor.source, false), true); + myViewNet->getUndoList()->add(new GNEChange_TAZSourceSink(TAZEdgeColor.source, false), true); } if (myViewNet->getNet()->getAttributeCarriers()->retrieveAdditional(TAZEdgeColor.sink, false)) { - myViewNet->getUndoList()->add(new GNEChange_Additional(TAZEdgeColor.sink, false), true); + myViewNet->getUndoList()->add(new GNEChange_TAZSourceSink(TAZEdgeColor.sink, false), true); } } // always refresh TAZ Edges after removing TAZSources/Sinks From 652a3fa95398086024c2f598954fb9655247d8bd Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 16:29:42 +0100 Subject: [PATCH 055/116] Disable memory reserve. Refs #16039 --- src/netedit/elements/GNEHierarchicalContainerChildren.h | 2 -- src/netedit/elements/GNEHierarchicalContainerParents.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/netedit/elements/GNEHierarchicalContainerChildren.h b/src/netedit/elements/GNEHierarchicalContainerChildren.h index 33d43170d336..fe32fbda7a28 100644 --- a/src/netedit/elements/GNEHierarchicalContainerChildren.h +++ b/src/netedit/elements/GNEHierarchicalContainerChildren.h @@ -32,8 +32,6 @@ class GNEHierarchicalContainerChildren : public std::vector { public: /// @brief default constructor GNEHierarchicalContainerChildren() { - // we reserve at least 5 positions - reserve(5); } /// @brief parameter constructor diff --git a/src/netedit/elements/GNEHierarchicalContainerParents.h b/src/netedit/elements/GNEHierarchicalContainerParents.h index d9ce48230147..6ff51ac3d457 100644 --- a/src/netedit/elements/GNEHierarchicalContainerParents.h +++ b/src/netedit/elements/GNEHierarchicalContainerParents.h @@ -32,8 +32,6 @@ class GNEHierarchicalContainerParents : public std::vector { public: /// @brief default constructor GNEHierarchicalContainerParents() { - // we reserve at least 5 positions - reserve(5); } /// @brief parameter constructor From 760bcfea060f453dc30784c0878923516861f1ef Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 16:41:11 +0100 Subject: [PATCH 056/116] Restored removed calls (due error). Refs #16039 --- src/netedit/changes/GNEChange.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/netedit/changes/GNEChange.h b/src/netedit/changes/GNEChange.h index 38321d1ff5c6..bfc074e5c782 100644 --- a/src/netedit/changes/GNEChange.h +++ b/src/netedit/changes/GNEChange.h @@ -132,6 +132,9 @@ class GNEChange : public FXObject { for (const auto& lane : myOriginalHierarchicalContainer.getParents()) { lane->addChildElement(element); } + for (const auto& additional : myOriginalHierarchicalContainer.getParents()) { + additional->addChildElement(element); + } for (const auto& sourceSink : myOriginalHierarchicalContainer.getParents()) { sourceSink->addChildElement(element); } @@ -151,8 +154,8 @@ class GNEChange : public FXObject { for (const auto& lane : myOriginalHierarchicalContainer.getChildren()) { lane->addParentElement(element); } - for (const auto& sourceSink : myOriginalHierarchicalContainer.getChildren()) { - sourceSink->addParentElement(element); + for (const auto& additional : myOriginalHierarchicalContainer.getChildren()) { + additional->addParentElement(element); } for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildren()) { TAZSourceSink->addParentElement(element); @@ -178,6 +181,9 @@ class GNEChange : public FXObject { for (const auto& lane : myOriginalHierarchicalContainer.getParents()) { lane->removeChildElement(element); } + for (const auto& additional : myOriginalHierarchicalContainer.getParents()) { + additional->removeChildElement(element); + } for (const auto& sourceSink : myOriginalHierarchicalContainer.getParents()) { sourceSink->removeChildElement(element); } @@ -197,8 +203,8 @@ class GNEChange : public FXObject { for (const auto& lane : myOriginalHierarchicalContainer.getChildren()) { lane->removeParentElement(element); } - for (const auto& sourceSink : myOriginalHierarchicalContainer.getChildren()) { - sourceSink->removeParentElement(element); + for (const auto& additional : myOriginalHierarchicalContainer.getChildren()) { + additional->removeParentElement(element); } for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildren()) { TAZSourceSink->removeParentElement(element); From e53882a6044f8bc0ba1c91348cb441ff1f2a5687 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Tue, 21 Jan 2025 16:41:11 +0100 Subject: [PATCH 057/116] starting to split the build process, refs #15213 --- tools/build_config/buildMacOSInstaller.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/build_config/buildMacOSInstaller.py b/tools/build_config/buildMacOSInstaller.py index af840aa548c1..ddfc7f0d868d 100755 --- a/tools/build_config/buildMacOSInstaller.py +++ b/tools/build_config/buildMacOSInstaller.py @@ -268,15 +268,15 @@ def create_framework(name, longname, pkg_id, version, sumo_build_directory, outp for file in proj_file_list: shutil.copy2(os.path.join(source_dir, file), os.path.join(dest_dir, file)) - # Signing the binaries and libraries - print(" - Signing binaries and libraries") - for dir_path in [bin_dir, lib_dir]: - for file in os.listdir(dir_path): - file_path = os.path.join(dir_path, file) - if os.path.isfile(file_path): - print(f" . Signing {file_path}...") - signed_file_path = sign_file(file_path) - shutil.move(signed_file_path, file_path) + # # Signing the binaries and libraries + # print(" - Signing binaries and libraries") + # for dir_path in [bin_dir, lib_dir]: + # for file in os.listdir(dir_path): + # file_path = os.path.join(dir_path, file) + # if os.path.isfile(file_path): + # print(f" . Signing {file_path}...") + # signed_file_path = sign_file(file_path) + # shutil.move(signed_file_path, file_path) # Build the framework package cwd = os.path.dirname(os.path.abspath(__file__)) @@ -520,7 +520,8 @@ def main(): # Building the framework package print("Building framework package 'EclipseSUMO'") - framework_pkg = create_framework("EclipseSUMO", "Eclipse SUMO", f"{base_id}.framework", version, opts.build_dir, opts.output_framework_dir) + framework_pkg = create_framework("EclipseSUMO", "Eclipse SUMO", f"{ + base_id}.framework", version, opts.build_dir, opts.output_framework_dir) print(f"Successfully built: '{framework_pkg[1]}' ({framework_pkg[4] / (1024 * 1024):.2f} MB)\n") # # Building all the app launchers packages From f15ee0a3369c35b67b437db164552a75359c5b5f Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Tue, 21 Jan 2025 17:23:25 +0100 Subject: [PATCH 058/116] fix #16053 --- src/netedit/GNENetHelper.cpp | 8 +++++--- src/netedit/elements/network/GNEJunction.cpp | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/netedit/GNENetHelper.cpp b/src/netedit/GNENetHelper.cpp index bfd1df3e1907..e56ea6e201f5 100644 --- a/src/netedit/GNENetHelper.cpp +++ b/src/netedit/GNENetHelper.cpp @@ -2417,9 +2417,11 @@ GNENetHelper::AttributeCarriers::deleteCrossing(GNECrossing* crossing) { myCrossings.erase(finder); myNumberOfNetworkElements--; // remove it from inspected elements and GNEElementTree - myNet->getViewNet()->getInspectedElements().uninspectAC(crossing); - crossing->unmarkForDrawingFront();; - myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(crossing); + if (myNet->getViewNet()) { + myNet->getViewNet()->getInspectedElements().uninspectAC(crossing); + crossing->unmarkForDrawingFront();; + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(crossing); + } } } diff --git a/src/netedit/elements/network/GNEJunction.cpp b/src/netedit/elements/network/GNEJunction.cpp index 177e13c6f40d..26a8ee509932 100644 --- a/src/netedit/elements/network/GNEJunction.cpp +++ b/src/netedit/elements/network/GNEJunction.cpp @@ -445,7 +445,9 @@ GNEJunction::rebuildGNECrossings(bool rebuildNBNodeCrossings) { crossing->unselectAttributeCarrier(); } // remove it from inspected ACS - myNet->getViewNet()->getInspectedElements().uninspectAC(crossing); + if (myNet->getViewNet()) { + myNet->getViewNet()->getInspectedElements().uninspectAC(crossing); + } // remove it from net myNet->removeGLObjectFromGrid(crossing); // remove it from attributeCarriers From 5cf10712f6d2c2700648780d31c89a68a1aba9b9 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Wed, 22 Jan 2025 09:38:27 +0100 Subject: [PATCH 059/116] added test for net2geojson refs #2 --- .../net/net2geojson/edgedata/errors.tools | 0 .../net/net2geojson/edgedata/geojson.tools | 1497 +++++++++++++++++ .../net2geojson/edgedata/input_edgedata.xml | 37 + .../net/net2geojson/edgedata/options.tools | 1 + .../net/net2geojson/edgedata/output.tools | 0 tests/tools/net/net2geojson/testsuite.tools | 3 + 6 files changed, 1538 insertions(+) create mode 100644 tests/tools/net/net2geojson/edgedata/errors.tools create mode 100644 tests/tools/net/net2geojson/edgedata/geojson.tools create mode 100644 tests/tools/net/net2geojson/edgedata/input_edgedata.xml create mode 100644 tests/tools/net/net2geojson/edgedata/options.tools create mode 100644 tests/tools/net/net2geojson/edgedata/output.tools diff --git a/tests/tools/net/net2geojson/edgedata/errors.tools b/tests/tools/net/net2geojson/edgedata/errors.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/net/net2geojson/edgedata/geojson.tools b/tests/tools/net/net2geojson/edgedata/geojson.tools new file mode 100644 index 000000000000..ee7a5bf37cd6 --- /dev/null +++ b/tests/tools/net/net2geojson/edgedata/geojson.tools @@ -0,0 +1,1497 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + 13.531263, + 52.429818 + ], + [ + 13.531081, + 52.42994 + ], + [ + 13.531059, + 52.429955 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "0", + "begin": "0.00", + "density": "3.36", + "departed": "45", + "element": "edge", + "end": "3635.00", + "entered": "0", + "id": "-142575691#0", + "laneChangedFrom": "0", + "laneChangedTo": "0", + "laneDensity": "3.36", + "left": "45", + "name": "Magnusstra\u00dfe", + "occupancy": "1.51", + "overlapTraveltime": "6.99", + "sampledSeconds": "251.82", + "speed": "3.66", + "speedRelative": "0.26", + "timeLoss": "155.67", + "traveltime": "5.88", + "waitingTime": "8.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529194, + 52.429342 + ], + [ + 13.529197, + 52.429338 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "128643753#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529359, + 52.429246 + ], + [ + 13.529367, + 52.429243 + ], + [ + 13.529504, + 52.429137 + ], + [ + 13.529751, + 52.42898 + ], + [ + 13.529906, + 52.428872 + ], + [ + 13.530158, + 52.428696 + ], + [ + 13.530212, + 52.428659 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "128643753#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530996, + 52.429919 + ], + [ + 13.531018, + 52.429904 + ], + [ + 13.5312, + 52.429783 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "105", + "begin": "0.00", + "density": "3.86", + "departed": "0", + "element": "edge", + "end": "3635.00", + "entered": "105", + "id": "142575691#0", + "laneChangedFrom": "0", + "laneChangedTo": "0", + "laneDensity": "3.86", + "left": "0", + "name": "Magnusstra\u00dfe", + "occupancy": "1.57", + "overlapTraveltime": "2.98", + "sampledSeconds": "289.26", + "speed": "8.59", + "speedRelative": "0.62", + "timeLoss": "111.29", + "traveltime": "2.47", + "waitingTime": "0.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529488, + 52.429606 + ], + [ + 13.529442, + 52.429611 + ], + [ + 13.529393, + 52.429624 + ], + [ + 13.529346, + 52.429643 + ], + [ + 13.529291, + 52.429676 + ], + [ + 13.529244, + 52.429713 + ], + [ + 13.528818, + 52.430215 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "116", + "begin": "0.00", + "density": "5.48", + "departed": "61", + "element": "edge", + "end": "3635.00", + "entered": "158", + "id": "142575692#0", + "laneChangedFrom": "0", + "laneChangedTo": "0", + "laneDensity": "5.48", + "left": "103", + "name": "Max-Born-Stra\u00dfe", + "occupancy": "2.61", + "overlapTraveltime": "7.82", + "sampledSeconds": "1675.40", + "speed": "11.39", + "speedRelative": "0.82", + "timeLoss": "303.81", + "traveltime": "7.43", + "waitingTime": "0.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.52876, + 52.430283 + ], + [ + 13.528648, + 52.430415 + ], + [ + 13.528173, + 52.430977 + ], + [ + 13.528144, + 52.431011 + ], + [ + 13.527969, + 52.431218 + ], + [ + 13.527258, + 52.432044 + ], + [ + 13.527209, + 52.432107 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "103", + "begin": "0.00", + "density": "2.17", + "departed": "0", + "element": "edge", + "end": "3635.00", + "entered": "103", + "id": "142575692#2", + "laneChangedFrom": "0", + "laneChangedTo": "0", + "laneDensity": "2.17", + "left": "0", + "name": "Max-Born-Stra\u00dfe", + "occupancy": "1.07", + "overlapTraveltime": "17.59", + "sampledSeconds": "1805.96", + "speed": "13.29", + "speedRelative": "0.96", + "timeLoss": "87.34", + "traveltime": "17.22", + "waitingTime": "0.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.527038, + 52.432033 + ], + [ + 13.527098, + 52.431975 + ], + [ + 13.527535, + 52.431494 + ], + [ + 13.528014, + 52.43092 + ], + [ + 13.528453, + 52.430403 + ], + [ + 13.528573, + 52.430259 + ], + [ + 13.528637, + 52.430187 + ], + [ + 13.529183, + 52.429535 + ], + [ + 13.529211, + 52.429501 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "0", + "begin": "0.00", + "density": "1.97", + "departed": "73", + "element": "edge", + "end": "3635.00", + "entered": "0", + "id": "142575693#0", + "laneChangedFrom": "0", + "laneChangedTo": "0", + "laneDensity": "1.97", + "left": "73", + "name": "Max-Born-Stra\u00dfe", + "occupancy": "0.97", + "overlapTraveltime": "31.68", + "sampledSeconds": "2276.06", + "speed": "10.20", + "speedRelative": "0.73", + "timeLoss": "541.34", + "traveltime": "30.61", + "waitingTime": "94.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.526873, + 52.428795 + ], + [ + 13.527033, + 52.428821 + ], + [ + 13.527555, + 52.428912 + ], + [ + 13.528005, + 52.428987 + ], + [ + 13.528416, + 52.429068 + ], + [ + 13.528584, + 52.429107 + ], + [ + 13.528989, + 52.42921 + ], + [ + 13.529207, + 52.429269 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "0", + "begin": "0.00", + "density": "3.04", + "departed": "118", + "element": "edge", + "end": "3635.00", + "entered": "0", + "id": "143308542#0", + "laneChangedFrom": "5", + "laneChangedTo": "5", + "laneDensity": "1.01", + "left": "118", + "name": "Rudower Chaussee", + "occupancy": "0.50", + "overlapTraveltime": "16.17", + "sampledSeconds": "1851.93", + "speed": "10.66", + "speedRelative": "0.77", + "timeLoss": "419.10", + "traveltime": "15.79", + "waitingTime": "0.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529334, + 52.429308 + ], + [ + 13.529597, + 52.429391 + ], + [ + 13.529894, + 52.429501 + ], + [ + 13.530053, + 52.429567 + ], + [ + 13.530089, + 52.429582 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "53", + "begin": "0.00", + "density": "11.94", + "departed": "137", + "element": "edge", + "end": "3635.00", + "entered": "118", + "id": "143308542#2", + "laneChangedFrom": "43", + "laneChangedTo": "43", + "laneDensity": "3.98", + "left": "202", + "name": "Rudower Chaussee", + "occupancy": "1.90", + "overlapTraveltime": "10.68", + "sampledSeconds": "2594.17", + "speed": "6.06", + "speedRelative": "0.44", + "timeLoss": "1449.43", + "traveltime": "9.79", + "waitingTime": "422.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530163, + 52.429614 + ], + [ + 13.530381, + 52.429712 + ], + [ + 13.530835, + 52.429928 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "83", + "begin": "0.00", + "density": "8.88", + "departed": "93", + "element": "edge", + "end": "3635.00", + "entered": "202", + "id": "143308542#4", + "laneChangedFrom": "5", + "laneChangedTo": "5", + "laneDensity": "2.96", + "left": "212", + "name": "Rudower Chaussee", + "occupancy": "1.37", + "overlapTraveltime": "6.50", + "sampledSeconds": "1857.40", + "speed": "9.62", + "speedRelative": "0.69", + "timeLoss": "556.39", + "traveltime": "5.99", + "waitingTime": "0.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530887, + 52.429952 + ], + [ + 13.530889, + 52.429953 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "94", + "begin": "0.00", + "density": "284.50", + "departed": "69", + "element": "edge", + "end": "3635.00", + "entered": "212", + "id": "143308542#5", + "laneChangedFrom": "0", + "laneChangedTo": "0", + "laneDensity": "94.83", + "left": "187", + "name": "Rudower Chaussee", + "occupancy": "1.85", + "overlapTraveltime": "0.84", + "sampledSeconds": "206.83", + "speed": "6.22", + "speedRelative": "0.45", + "timeLoss": "83.86", + "traveltime": "0.03", + "waitingTime": "2.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.53104, + 52.430023 + ], + [ + 13.531592, + 52.430283 + ], + [ + 13.531904, + 52.430406 + ], + [ + 13.532542, + 52.430632 + ], + [ + 13.532598, + 52.430652 + ], + [ + 13.532799, + 52.430723 + ], + [ + 13.532945, + 52.430778 + ], + [ + 13.533173, + 52.430863 + ], + [ + 13.533415, + 52.430973 + ], + [ + 13.533692, + 52.431138 + ], + [ + 13.53417, + 52.431442 + ], + [ + 13.534228, + 52.431478 + ], + [ + 13.534696, + 52.431773 + ], + [ + 13.534954, + 52.431936 + ], + [ + 13.535042, + 52.431992 + ], + [ + 13.535196, + 52.432089 + ], + [ + 13.535246, + 52.43212 + ], + [ + 13.53537, + 52.432198 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "127", + "begin": "0.00", + "density": "2.69", + "departed": "0", + "element": "edge", + "end": "3635.00", + "entered": "127", + "id": "143308542#6", + "laneChangedFrom": "23", + "laneChangedTo": "23", + "laneDensity": "0.90", + "left": "0", + "name": "Rudower Chaussee", + "occupancy": "0.44", + "overlapTraveltime": "29.64", + "sampledSeconds": "3755.18", + "speed": "13.11", + "speedRelative": "0.94", + "timeLoss": "218.46", + "traveltime": "29.26", + "waitingTime": "0.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.531253, + 52.430365 + ], + [ + 13.531205, + 52.430345 + ], + [ + 13.530993, + 52.430257 + ], + [ + 13.530822, + 52.430176 + ], + [ + 13.530684, + 52.430111 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "0", + "begin": "0.00", + "density": "7.23", + "departed": "190", + "element": "edge", + "end": "3635.00", + "entered": "0", + "id": "143308546#0", + "laneChangedFrom": "2", + "laneChangedTo": "2", + "laneDensity": "2.41", + "left": "190", + "name": "Rudower Chaussee", + "occupancy": "1.17", + "overlapTraveltime": "7.33", + "sampledSeconds": "1258.99", + "speed": "7.22", + "speedRelative": "0.52", + "timeLoss": "598.67", + "traveltime": "6.94", + "waitingTime": "0.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530626, + 52.430083 + ], + [ + 13.530106, + 52.429839 + ], + [ + 13.529965, + 52.429774 + ], + [ + 13.529951, + 52.429768 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "59", + "begin": "0.00", + "density": "21.32", + "departed": "187", + "element": "edge", + "end": "3635.00", + "entered": "190", + "id": "143308546#1", + "laneChangedFrom": "83", + "laneChangedTo": "83", + "laneDensity": "7.11", + "left": "318", + "name": "Rudower Chaussee", + "occupancy": "3.40", + "overlapTraveltime": "12.43", + "sampledSeconds": "4476.19", + "speed": "5.05", + "speedRelative": "0.36", + "timeLoss": "2845.35", + "traveltime": "11.48", + "waitingTime": "1090.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529875, + 52.429733 + ], + [ + 13.529638, + 52.429623 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "73", + "begin": "0.00", + "density": "23.50", + "departed": "146", + "element": "edge", + "end": "3635.00", + "entered": "318", + "id": "143308546#3", + "laneChangedFrom": "4", + "laneChangedTo": "4", + "laneDensity": "7.83", + "left": "391", + "name": "Rudower Chaussee", + "occupancy": "3.33", + "overlapTraveltime": "4.01", + "sampledSeconds": "1731.22", + "speed": "6.30", + "speedRelative": "0.45", + "timeLoss": "922.19", + "traveltime": "3.35", + "waitingTime": "0.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529212, + 52.429428 + ], + [ + 13.529169, + 52.42941 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "121", + "begin": "0.00", + "density": "25.14", + "departed": "60", + "element": "edge", + "end": "3635.00", + "entered": "306", + "id": "143308546#7", + "laneChangedFrom": "2", + "laneChangedTo": "2", + "laneDensity": "8.38", + "left": "245", + "name": "Rudower Chaussee", + "occupancy": "1.92", + "overlapTraveltime": "1.01", + "sampledSeconds": "325.37", + "speed": "8.49", + "speedRelative": "0.61", + "timeLoss": "123.77", + "traveltime": "0.34", + "waitingTime": "1.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529115, + 52.429391 + ], + [ + 13.529097, + 52.429386 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "159", + "begin": "0.00", + "density": "43.19", + "departed": "50", + "element": "edge", + "end": "3635.00", + "entered": "245", + "id": "143308546#8", + "laneChangedFrom": "0", + "laneChangedTo": "0", + "laneDensity": "14.40", + "left": "136", + "name": "Rudower Chaussee", + "occupancy": "1.63", + "overlapTraveltime": "0.87", + "sampledSeconds": "213.50", + "speed": "7.34", + "speedRelative": "0.53", + "timeLoss": "98.70", + "traveltime": "0.15", + "waitingTime": "0.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.52901, + 52.42936 + ], + [ + 13.52891, + 52.42933 + ], + [ + 13.528511, + 52.429231 + ], + [ + 13.528346, + 52.429198 + ], + [ + 13.528068, + 52.429145 + ], + [ + 13.527661, + 52.429077 + ], + [ + 13.527149, + 52.428992 + ] + ], + "type": "LineString" + }, + "properties": { + "arrived": "136", + "begin": "0.00", + "density": "3.07", + "departed": "0", + "element": "edge", + "end": "3635.00", + "entered": "136", + "id": "143308546#9", + "laneChangedFrom": "0", + "laneChangedTo": "0", + "laneDensity": "1.02", + "left": "0", + "name": "Rudower Chaussee", + "occupancy": "0.49", + "overlapTraveltime": "11.01", + "sampledSeconds": "1488.26", + "speed": "12.55", + "speedRelative": "0.90", + "timeLoss": "124.99", + "traveltime": "10.62", + "waitingTime": "0.00" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.526465, + 52.432491 + ], + [ + 13.526564, + 52.432429 + ], + [ + 13.526902, + 52.432216 + ], + [ + 13.527014, + 52.432142 + ], + [ + 13.527108, + 52.432062 + ], + [ + 13.527135, + 52.432033 + ], + [ + 13.527161, + 52.432001 + ], + [ + 13.528084, + 52.430945 + ], + [ + 13.528524, + 52.430409 + ], + [ + 13.529153, + 52.429676 + ], + [ + 13.529198, + 52.429632 + ], + [ + 13.529256, + 52.429584 + ], + [ + 13.529298, + 52.429566 + ], + [ + 13.52937, + 52.429541 + ], + [ + 13.529469, + 52.429524 + ], + [ + 13.529491, + 52.429524 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "158236729#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529693, + 52.429529 + ], + [ + 13.5297, + 52.42953 + ], + [ + 13.529817, + 52.429557 + ], + [ + 13.530084, + 52.429659 + ], + [ + 13.530349, + 52.429788 + ], + [ + 13.530604, + 52.429908 + ], + [ + 13.530672, + 52.429944 + ], + [ + 13.530753, + 52.429987 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "158236729#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.535316, + 52.432363 + ], + [ + 13.535214, + 52.432295 + ], + [ + 13.53509, + 52.432219 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "206889079#5", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.535087, + 52.432217 + ], + [ + 13.53462, + 52.431912 + ], + [ + 13.533942, + 52.431478 + ], + [ + 13.533724, + 52.431339 + ], + [ + 13.533484, + 52.431187 + ], + [ + 13.533213, + 52.43103 + ], + [ + 13.532996, + 52.430927 + ], + [ + 13.532679, + 52.430809 + ], + [ + 13.532201, + 52.43062 + ], + [ + 13.531519, + 52.430363 + ], + [ + 13.531118, + 52.430201 + ], + [ + 13.530787, + 52.430044 + ], + [ + 13.530779, + 52.43004 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "206889079#6", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530721, + 52.430011 + ], + [ + 13.530586, + 52.429944 + ], + [ + 13.530317, + 52.429813 + ], + [ + 13.530104, + 52.429709 + ], + [ + 13.530037, + 52.429677 + ], + [ + 13.529804, + 52.429584 + ], + [ + 13.529707, + 52.42956 + ], + [ + 13.529694, + 52.429559 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "206889079#7", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530811, + 52.430018 + ], + [ + 13.530832, + 52.43003 + ], + [ + 13.531145, + 52.430177 + ], + [ + 13.531543, + 52.430348 + ], + [ + 13.532511, + 52.43071 + ], + [ + 13.53272, + 52.430782 + ], + [ + 13.532933, + 52.430872 + ], + [ + 13.533102, + 52.430941 + ], + [ + 13.533227, + 52.431 + ], + [ + 13.533415, + 52.431103 + ], + [ + 13.533576, + 52.431202 + ], + [ + 13.533961, + 52.431449 + ], + [ + 13.535052, + 52.432145 + ], + [ + 13.535126, + 52.432195 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "220198808#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.535126, + 52.432195 + ], + [ + 13.535252, + 52.432271 + ], + [ + 13.53536, + 52.432338 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "220198808#2", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.52949, + 52.42955 + ], + [ + 13.529486, + 52.42955 + ], + [ + 13.529383, + 52.429567 + ], + [ + 13.52929, + 52.4296 + ], + [ + 13.529233, + 52.429645 + ], + [ + 13.528573, + 52.430409 + ], + [ + 13.528112, + 52.430953 + ], + [ + 13.527197, + 52.432018 + ], + [ + 13.527171, + 52.432047 + ], + [ + 13.527141, + 52.432076 + ], + [ + 13.527043, + 52.432156 + ], + [ + 13.526926, + 52.432232 + ], + [ + 13.526592, + 52.432444 + ], + [ + 13.526369, + 52.432586 + ], + [ + 13.526163, + 52.432723 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "220198810#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.528864, + 52.430238 + ], + [ + 13.52899, + 52.430198 + ], + [ + 13.529142, + 52.430143 + ], + [ + 13.529435, + 52.429979 + ], + [ + 13.529783, + 52.429827 + ], + [ + 13.52984, + 52.429794 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "312889498", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.528432, + 52.429775 + ], + [ + 13.528515, + 52.429657 + ], + [ + 13.52872, + 52.429545 + ], + [ + 13.528987, + 52.429423 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "328287315", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.53072, + 52.430047 + ], + [ + 13.530722, + 52.430046 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096580#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530804, + 52.429988 + ], + [ + 13.530806, + 52.429987 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096580#3", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529986, + 52.429703 + ], + [ + 13.530002, + 52.429691 + ], + [ + 13.53004, + 52.429661 + ], + [ + 13.530057, + 52.429648 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096589#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530195, + 52.429553 + ], + [ + 13.530203, + 52.429546 + ], + [ + 13.530224, + 52.42952 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096589#3", + "name": "" + }, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} diff --git a/tests/tools/net/net2geojson/edgedata/input_edgedata.xml b/tests/tools/net/net2geojson/edgedata/input_edgedata.xml new file mode 100644 index 000000000000..d1623843fa70 --- /dev/null +++ b/tests/tools/net/net2geojson/edgedata/input_edgedata.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tools/net/net2geojson/edgedata/options.tools b/tests/tools/net/net2geojson/edgedata/options.tools new file mode 100644 index 000000000000..b29fe0c272e7 --- /dev/null +++ b/tests/tools/net/net2geojson/edgedata/options.tools @@ -0,0 +1 @@ +-n input_net.net.xml -o output.geojson --edgedata-file input_edgedata.xml tools/net/net2geojson.py diff --git a/tests/tools/net/net2geojson/edgedata/output.tools b/tests/tools/net/net2geojson/edgedata/output.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/net/net2geojson/testsuite.tools b/tests/tools/net/net2geojson/testsuite.tools index 668e19a3b584..75ea209adbae 100644 --- a/tests/tools/net/net2geojson/testsuite.tools +++ b/tests/tools/net/net2geojson/testsuite.tools @@ -22,3 +22,6 @@ extra # write extra attributes for all lanes extra_lanes + +# write kml edge geometries including edgedata +edgedata From 09395fdcb081d2af959268bfafa75d23ce5be7ad Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Wed, 22 Jan 2025 09:53:18 +0100 Subject: [PATCH 060/116] added test refs #21, #16055 --- tests/polyconvert/config.polyconvert | 1 + .../import/geojson/no_crs/errors.polyconvert | 0 .../import/geojson/no_crs/input.geojson | 1209 +++++++++++++++++ .../import/geojson/no_crs/options.polyconvert | 2 + .../import/geojson/no_crs/output.polyconvert | 5 + .../import/geojson/no_crs/pois.polyconvert | 68 + .../import/geojson/testsuite.polyconvert | 2 + .../polyconvert/import/testsuite.polyconvert | 3 + 8 files changed, 1290 insertions(+) create mode 100644 tests/polyconvert/import/geojson/no_crs/errors.polyconvert create mode 100644 tests/polyconvert/import/geojson/no_crs/input.geojson create mode 100644 tests/polyconvert/import/geojson/no_crs/options.polyconvert create mode 100644 tests/polyconvert/import/geojson/no_crs/output.polyconvert create mode 100644 tests/polyconvert/import/geojson/no_crs/pois.polyconvert create mode 100644 tests/polyconvert/import/geojson/testsuite.polyconvert diff --git a/tests/polyconvert/config.polyconvert b/tests/polyconvert/config.polyconvert index c0630c89118e..d29bad525d6b 100644 --- a/tests/polyconvert/config.polyconvert +++ b/tests/polyconvert/config.polyconvert @@ -2,6 +2,7 @@ import_config_file:../config_all binary:$POLYCONVERT_BINARY copy_test_path:input_net.net.xml copy_test_path:input_poi.poi.xml +copy_test_path:input.geojson copy_test_path:dlr_navteq_pois.txt copy_test_path:dlr_navteq_polygons.txt copy_test_path:osm.xml diff --git a/tests/polyconvert/import/geojson/no_crs/errors.polyconvert b/tests/polyconvert/import/geojson/no_crs/errors.polyconvert new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/polyconvert/import/geojson/no_crs/input.geojson b/tests/polyconvert/import/geojson/no_crs/input.geojson new file mode 100644 index 000000000000..c7c1e8d36188 --- /dev/null +++ b/tests/polyconvert/import/geojson/no_crs/input.geojson @@ -0,0 +1,1209 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + 13.531263, + 52.429818 + ], + [ + 13.531081, + 52.42994 + ], + [ + 13.531059, + 52.429955 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "-142575691#0", + "name": "Magnusstra\u00dfe" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529194, + 52.429342 + ], + [ + 13.529197, + 52.429338 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "128643753#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529359, + 52.429246 + ], + [ + 13.529367, + 52.429243 + ], + [ + 13.529504, + 52.429137 + ], + [ + 13.529751, + 52.42898 + ], + [ + 13.529906, + 52.428872 + ], + [ + 13.530158, + 52.428696 + ], + [ + 13.530212, + 52.428659 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "128643753#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530996, + 52.429919 + ], + [ + 13.531018, + 52.429904 + ], + [ + 13.5312, + 52.429783 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "142575691#0", + "name": "Magnusstra\u00dfe" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529488, + 52.429606 + ], + [ + 13.529442, + 52.429611 + ], + [ + 13.529393, + 52.429624 + ], + [ + 13.529346, + 52.429643 + ], + [ + 13.529291, + 52.429676 + ], + [ + 13.529244, + 52.429713 + ], + [ + 13.528818, + 52.430215 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "142575692#0", + "name": "Max-Born-Stra\u00dfe" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.52876, + 52.430283 + ], + [ + 13.528648, + 52.430415 + ], + [ + 13.528173, + 52.430977 + ], + [ + 13.528144, + 52.431011 + ], + [ + 13.527969, + 52.431218 + ], + [ + 13.527258, + 52.432044 + ], + [ + 13.527209, + 52.432107 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "142575692#2", + "name": "Max-Born-Stra\u00dfe" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.527038, + 52.432033 + ], + [ + 13.527098, + 52.431975 + ], + [ + 13.527535, + 52.431494 + ], + [ + 13.528014, + 52.43092 + ], + [ + 13.528453, + 52.430403 + ], + [ + 13.528573, + 52.430259 + ], + [ + 13.528637, + 52.430187 + ], + [ + 13.529183, + 52.429535 + ], + [ + 13.529211, + 52.429501 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "142575693#0", + "name": "Max-Born-Stra\u00dfe" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.526873, + 52.428795 + ], + [ + 13.527033, + 52.428821 + ], + [ + 13.527555, + 52.428912 + ], + [ + 13.528005, + 52.428987 + ], + [ + 13.528416, + 52.429068 + ], + [ + 13.528584, + 52.429107 + ], + [ + 13.528989, + 52.42921 + ], + [ + 13.529207, + 52.429269 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308542#0", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529334, + 52.429308 + ], + [ + 13.529597, + 52.429391 + ], + [ + 13.529894, + 52.429501 + ], + [ + 13.530053, + 52.429567 + ], + [ + 13.530089, + 52.429582 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308542#2", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530163, + 52.429614 + ], + [ + 13.530381, + 52.429712 + ], + [ + 13.530835, + 52.429928 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308542#4", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530887, + 52.429952 + ], + [ + 13.530889, + 52.429953 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308542#5", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.53104, + 52.430023 + ], + [ + 13.531592, + 52.430283 + ], + [ + 13.531904, + 52.430406 + ], + [ + 13.532542, + 52.430632 + ], + [ + 13.532598, + 52.430652 + ], + [ + 13.532799, + 52.430723 + ], + [ + 13.532945, + 52.430778 + ], + [ + 13.533173, + 52.430863 + ], + [ + 13.533415, + 52.430973 + ], + [ + 13.533692, + 52.431138 + ], + [ + 13.53417, + 52.431442 + ], + [ + 13.534228, + 52.431478 + ], + [ + 13.534696, + 52.431773 + ], + [ + 13.534954, + 52.431936 + ], + [ + 13.535042, + 52.431992 + ], + [ + 13.535196, + 52.432089 + ], + [ + 13.535246, + 52.43212 + ], + [ + 13.53537, + 52.432198 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308542#6", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.531253, + 52.430365 + ], + [ + 13.531205, + 52.430345 + ], + [ + 13.530993, + 52.430257 + ], + [ + 13.530822, + 52.430176 + ], + [ + 13.530684, + 52.430111 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#0", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530626, + 52.430083 + ], + [ + 13.530106, + 52.429839 + ], + [ + 13.529965, + 52.429774 + ], + [ + 13.529951, + 52.429768 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#1", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529875, + 52.429733 + ], + [ + 13.529638, + 52.429623 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#3", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529212, + 52.429428 + ], + [ + 13.529169, + 52.42941 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#7", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529115, + 52.429391 + ], + [ + 13.529097, + 52.429386 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#8", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.52901, + 52.42936 + ], + [ + 13.52891, + 52.42933 + ], + [ + 13.528511, + 52.429231 + ], + [ + 13.528346, + 52.429198 + ], + [ + 13.528068, + 52.429145 + ], + [ + 13.527661, + 52.429077 + ], + [ + 13.527149, + 52.428992 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#9", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.526465, + 52.432491 + ], + [ + 13.526564, + 52.432429 + ], + [ + 13.526902, + 52.432216 + ], + [ + 13.527014, + 52.432142 + ], + [ + 13.527108, + 52.432062 + ], + [ + 13.527135, + 52.432033 + ], + [ + 13.527161, + 52.432001 + ], + [ + 13.528084, + 52.430945 + ], + [ + 13.528524, + 52.430409 + ], + [ + 13.529153, + 52.429676 + ], + [ + 13.529198, + 52.429632 + ], + [ + 13.529256, + 52.429584 + ], + [ + 13.529298, + 52.429566 + ], + [ + 13.52937, + 52.429541 + ], + [ + 13.529469, + 52.429524 + ], + [ + 13.529491, + 52.429524 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "158236729#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529693, + 52.429529 + ], + [ + 13.5297, + 52.42953 + ], + [ + 13.529817, + 52.429557 + ], + [ + 13.530084, + 52.429659 + ], + [ + 13.530349, + 52.429788 + ], + [ + 13.530604, + 52.429908 + ], + [ + 13.530672, + 52.429944 + ], + [ + 13.530753, + 52.429987 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "158236729#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.535316, + 52.432363 + ], + [ + 13.535214, + 52.432295 + ], + [ + 13.53509, + 52.432219 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "206889079#5", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.535087, + 52.432217 + ], + [ + 13.53462, + 52.431912 + ], + [ + 13.533942, + 52.431478 + ], + [ + 13.533724, + 52.431339 + ], + [ + 13.533484, + 52.431187 + ], + [ + 13.533213, + 52.43103 + ], + [ + 13.532996, + 52.430927 + ], + [ + 13.532679, + 52.430809 + ], + [ + 13.532201, + 52.43062 + ], + [ + 13.531519, + 52.430363 + ], + [ + 13.531118, + 52.430201 + ], + [ + 13.530787, + 52.430044 + ], + [ + 13.530779, + 52.43004 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "206889079#6", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530721, + 52.430011 + ], + [ + 13.530586, + 52.429944 + ], + [ + 13.530317, + 52.429813 + ], + [ + 13.530104, + 52.429709 + ], + [ + 13.530037, + 52.429677 + ], + [ + 13.529804, + 52.429584 + ], + [ + 13.529707, + 52.42956 + ], + [ + 13.529694, + 52.429559 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "206889079#7", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530811, + 52.430018 + ], + [ + 13.530832, + 52.43003 + ], + [ + 13.531145, + 52.430177 + ], + [ + 13.531543, + 52.430348 + ], + [ + 13.532511, + 52.43071 + ], + [ + 13.53272, + 52.430782 + ], + [ + 13.532933, + 52.430872 + ], + [ + 13.533102, + 52.430941 + ], + [ + 13.533227, + 52.431 + ], + [ + 13.533415, + 52.431103 + ], + [ + 13.533576, + 52.431202 + ], + [ + 13.533961, + 52.431449 + ], + [ + 13.535052, + 52.432145 + ], + [ + 13.535126, + 52.432195 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "220198808#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.535126, + 52.432195 + ], + [ + 13.535252, + 52.432271 + ], + [ + 13.53536, + 52.432338 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "220198808#2", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.52949, + 52.42955 + ], + [ + 13.529486, + 52.42955 + ], + [ + 13.529383, + 52.429567 + ], + [ + 13.52929, + 52.4296 + ], + [ + 13.529233, + 52.429645 + ], + [ + 13.528573, + 52.430409 + ], + [ + 13.528112, + 52.430953 + ], + [ + 13.527197, + 52.432018 + ], + [ + 13.527171, + 52.432047 + ], + [ + 13.527141, + 52.432076 + ], + [ + 13.527043, + 52.432156 + ], + [ + 13.526926, + 52.432232 + ], + [ + 13.526592, + 52.432444 + ], + [ + 13.526369, + 52.432586 + ], + [ + 13.526163, + 52.432723 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "220198810#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.528864, + 52.430238 + ], + [ + 13.52899, + 52.430198 + ], + [ + 13.529142, + 52.430143 + ], + [ + 13.529435, + 52.429979 + ], + [ + 13.529783, + 52.429827 + ], + [ + 13.52984, + 52.429794 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "312889498", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.528432, + 52.429775 + ], + [ + 13.528515, + 52.429657 + ], + [ + 13.52872, + 52.429545 + ], + [ + 13.528987, + 52.429423 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "328287315", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.53072, + 52.430047 + ], + [ + 13.530722, + 52.430046 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096580#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530804, + 52.429988 + ], + [ + 13.530806, + 52.429987 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096580#3", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529986, + 52.429703 + ], + [ + 13.530002, + 52.429691 + ], + [ + 13.53004, + 52.429661 + ], + [ + 13.530057, + 52.429648 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096589#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530195, + 52.429553 + ], + [ + 13.530203, + 52.429546 + ], + [ + 13.530224, + 52.42952 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096589#3", + "name": "" + }, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} diff --git a/tests/polyconvert/import/geojson/no_crs/options.polyconvert b/tests/polyconvert/import/geojson/no_crs/options.polyconvert new file mode 100644 index 000000000000..66fade25285b --- /dev/null +++ b/tests/polyconvert/import/geojson/no_crs/options.polyconvert @@ -0,0 +1,2 @@ +-v --geojson-files input.geojson -o pois.poi.xml + diff --git a/tests/polyconvert/import/geojson/no_crs/output.polyconvert b/tests/polyconvert/import/geojson/no_crs/output.polyconvert new file mode 100644 index 000000000000..5dfb12f033ff --- /dev/null +++ b/tests/polyconvert/import/geojson/no_crs/output.polyconvert @@ -0,0 +1,5 @@ +Parsing from geojson-file 'input.geojson' ... +Available fields: element id name + done. + done. +Success. diff --git a/tests/polyconvert/import/geojson/no_crs/pois.polyconvert b/tests/polyconvert/import/geojson/no_crs/pois.polyconvert new file mode 100644 index 000000000000..03ad9a7a80d5 --- /dev/null +++ b/tests/polyconvert/import/geojson/no_crs/pois.polyconvert @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/polyconvert/import/geojson/testsuite.polyconvert b/tests/polyconvert/import/geojson/testsuite.polyconvert new file mode 100644 index 000000000000..4b0ecc216189 --- /dev/null +++ b/tests/polyconvert/import/geojson/testsuite.polyconvert @@ -0,0 +1,2 @@ +# geojson comes without crs and should be interpreted as lon,lat +no_crs diff --git a/tests/polyconvert/import/testsuite.polyconvert b/tests/polyconvert/import/testsuite.polyconvert index c409880f76de..cd96b4f70cde 100644 --- a/tests/polyconvert/import/testsuite.polyconvert +++ b/tests/polyconvert/import/testsuite.polyconvert @@ -6,3 +6,6 @@ dlr_navteq # importing our own XML format XML + +# test import of geojson files +geojson From 8efd461631c918125f83086d945040cbe739a407 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Wed, 22 Jan 2025 09:53:30 +0100 Subject: [PATCH 061/116] added import option refs #16055 --- src/polyconvert/PCLoaderArcView.cpp | 23 +++++++++++++---------- src/polyconvert/polyconvert_main.cpp | 11 ++++++++++- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/polyconvert/PCLoaderArcView.cpp b/src/polyconvert/PCLoaderArcView.cpp index f3e973b45259..e42326d85a93 100644 --- a/src/polyconvert/PCLoaderArcView.cpp +++ b/src/polyconvert/PCLoaderArcView.cpp @@ -63,14 +63,19 @@ bool PCLoaderArcView::myWarnMissingProjection = true; // =========================================================================== void PCLoaderArcView::loadIfSet(OptionsCont& oc, PCPolyContainer& toFill, PCTypeMap& tm) { - if (!oc.isSet("shapefile-prefixes")) { + if (!oc.isSet("shapefile-prefixes") && !oc.isSet("geojson-files")) { return; } // parse file(s) - std::vector files = oc.getStringVector("shapefile-prefixes"); - for (std::vector::const_iterator file = files.begin(); file != files.end(); ++file) { - PROGRESS_BEGIN_MESSAGE("Parsing from shape-file '" + *file + "'"); - load(*file, oc, toFill, tm); + for (std::string file : oc.getStringVector("shapefile-prefixes")) { + file += ".shp"; + PROGRESS_BEGIN_MESSAGE("Parsing from shape-file '" + file + "'"); + load(file, oc, toFill, tm); + PROGRESS_DONE_MESSAGE(); + } + for (const std::string& file : oc.getStringVector("geojson-files")) { + PROGRESS_BEGIN_MESSAGE("Parsing from geojson-file '" + file + "'"); + load(file, oc, toFill, tm); PROGRESS_DONE_MESSAGE(); } } @@ -120,8 +125,6 @@ PCLoaderArcView::load(const std::string& file, OptionsCont& oc, PCPolyContainer& // get defaults const std::string idField = oc.getString("shapefile.id-column"); const bool useRunningID = oc.getBool("shapefile.use-running-id") || idField == ""; - // start parsing - std::string shpName = file + ".shp"; int fillType = -1; if (oc.getString("shapefile.fill") == "true") { fillType = 1; @@ -130,13 +133,13 @@ PCLoaderArcView::load(const std::string& file, OptionsCont& oc, PCPolyContainer& } #if GDAL_VERSION_MAJOR < 2 OGRRegisterAll(); - OGRDataSource* poDS = OGRSFDriverRegistrar::Open(shpName.c_str(), FALSE); + OGRDataSource* poDS = OGRSFDriverRegistrar::Open(file.c_str(), FALSE); #else GDALAllRegister(); - GDALDataset* poDS = (GDALDataset*) GDALOpenEx(shpName.c_str(), GDAL_OF_VECTOR | GA_ReadOnly, NULL, NULL, NULL); + GDALDataset* poDS = (GDALDataset*) GDALOpenEx(file.c_str(), GDAL_OF_VECTOR | GA_ReadOnly, NULL, NULL, NULL); #endif if (poDS == NULL) { - throw ProcessError(TLF("Could not open shape description '%'.", shpName)); + throw ProcessError(TLF("Could not open shape description '%'.", file)); } // begin file parsing diff --git a/src/polyconvert/polyconvert_main.cpp b/src/polyconvert/polyconvert_main.cpp index 00f720236cad..2ec090b6f1a5 100644 --- a/src/polyconvert/polyconvert_main.cpp +++ b/src/polyconvert/polyconvert_main.cpp @@ -110,6 +110,10 @@ fillOptions() { oc.doRegister("osm.merge-relations", new Option_Float(-1)); oc.addDescription("osm.merge-relations", "Input", TL("If FLOAT >= 0, assemble one polygon from all ways of a relation if they all connect with gaps below FLOAT")); + // geojson import + oc.doRegister("geojson-files", new Option_FileName()); + oc.addDescription("geojson-files", "Input", TL("Reads shapes from geojson FILE")); + // arcview import oc.doRegister("shapefile-prefixes", new Option_FileName()); oc.addSynonyme("shapefile-prefixes", "shapefile-prefix"); @@ -263,7 +267,12 @@ main(int argc, char** argv) { // from the given options #ifdef PROJ_API_FILE const int numProjections = oc.getBool("simple-projection") + oc.getBool("proj.utm") + oc.getBool("proj.dhdn") + (oc.getString("proj").length() > 1); - if ((oc.isSet("osm-files") || oc.isSet("dlr-navteq-poly-files") || oc.isSet("dlr-navteq-poi-files") || oc.isSet("shapefile-prefixes")) && numProjections == 0) { + if ((oc.isSet("osm-files") + || oc.isSet("dlr-navteq-poly-files") + || oc.isSet("dlr-navteq-poi-files") + || oc.isSet("geojson-files") + || oc.isSet("shapefile-prefixes")) + && numProjections == 0) { // input is lon,lat and projecting it to UTM ensures accurate handling of geometry oc.set("proj.utm", "true"); if (oc.isDefault("proj.plain-geo")) { From 315df4021aa11bf688cb06c1f632d4e54f52f9e0 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Wed, 22 Jan 2025 09:53:50 +0100 Subject: [PATCH 062/116] patching expected results. refs #21, #16055 --- tests/polyconvert/meta/help/output.polyconvert | 3 ++- tests/polyconvert/meta/write_template_full/cfg.polyconvert | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/polyconvert/meta/help/output.polyconvert b/tests/polyconvert/meta/help/output.polyconvert index e8f0ad5e2467..1ed8a99ccb74 100644 --- a/tests/polyconvert/meta/help/output.polyconvert +++ b/tests/polyconvert/meta/help/output.polyconvert @@ -1,4 +1,4 @@ -Eclipse SUMO polyconvert Version v1_21_0+0462-0373bcb962f +Eclipse SUMO polyconvert Version v1_21_0+1946-5cf10712f6d Copyright (C) 2001-2025 German Aerospace Center (DLR) and others; https://sumo.dlr.de Importer of polygons and POIs for the microscopic, multi-modal traffic simulation SUMO. @@ -36,6 +36,7 @@ Input Options: --osm.merge-relations FLOAT If FLOAT >= 0, assemble one polygon from all ways of a relation if they all connect with gaps below FLOAT + --geojson-files FILE Reads shapes from geojson FILE --shapefile-prefixes FILE Reads shapes from shapefiles FILE --shapefile.guess-projection Guesses the shapefile's projection --shapefile.traditional-axis-mapping Use traditional axis order (lon, lat) diff --git a/tests/polyconvert/meta/write_template_full/cfg.polyconvert b/tests/polyconvert/meta/write_template_full/cfg.polyconvert index bf22f9989785..6d660c2c0f28 100644 --- a/tests/polyconvert/meta/write_template_full/cfg.polyconvert +++ b/tests/polyconvert/meta/write_template_full/cfg.polyconvert @@ -1,6 +1,6 @@ - @@ -25,6 +25,7 @@ + From 045d802cd0be4383ffb4442a6d39ceed03045ed0 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Wed, 22 Jan 2025 09:56:05 +0100 Subject: [PATCH 063/116] Fixed error in GNEHierarchicalStructure::removeParentElement(). Refs #16039 --- src/netedit/elements/GNEHierarchicalStructure.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index 73ad5e682dd2..fb38baa28faf 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -149,23 +149,23 @@ GNEHierarchicalStructure::removeParentElement(GNELane* lane) { template <> void -GNEHierarchicalStructure::removeParentElement(GNETAZSourceSink* TAZSourceSink) { - auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), TAZSourceSink); +GNEHierarchicalStructure::removeParentElement(GNEAdditional* additional) { + auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional); if (it != myParentAdditionals.end()) { myParentAdditionals.erase(it); } else { - throw ProcessError(TAZSourceSink->getTagStr() + " with ID='" + TAZSourceSink->getID() + "' is not a parent element"); + throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' is not a parent element"); } } template <> void -GNEHierarchicalStructure::removeParentElement(GNEAdditional* additional) { - auto it = std::find(myParentTAZSourceSinks.begin(), myParentTAZSourceSinks.end(), additional); +GNEHierarchicalStructure::removeParentElement(GNETAZSourceSink* TAZSourceSink) { + auto it = std::find(myParentTAZSourceSinks.begin(), myParentTAZSourceSinks.end(), TAZSourceSink); if (it != myParentTAZSourceSinks.end()) { myParentTAZSourceSinks.erase(it); } else { - throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' is not a parent element"); + throw ProcessError(TAZSourceSink->getTagStr() + " with ID='" + TAZSourceSink->getID() + "' is not a parent element"); } } From 1a33407923d1df0ad042345890088470fbc3d317 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Wed, 22 Jan 2025 10:26:36 +0100 Subject: [PATCH 064/116] Improved support of TAZSourceSinks. Refs #16039 --- src/netedit/GNENet.cpp | 24 ++++++++++++++++--- src/netedit/GNENet.h | 8 ++++++- .../elements/GNEHierarchicalElement.cpp | 3 +++ .../additional/GNEAdditionalHandler.cpp | 4 ++-- src/netedit/elements/additional/GNETAZ.cpp | 16 ++++++------- src/netedit/elements/network/GNEEdge.cpp | 18 ++++---------- .../elements/network/GNENetworkElement.cpp | 2 +- src/netedit/frames/GNEElementTree.cpp | 8 +++++++ 8 files changed, 55 insertions(+), 28 deletions(-) diff --git a/src/netedit/GNENet.cpp b/src/netedit/GNENet.cpp index b9ec1dd193c1..2b4647d84a8e 100644 --- a/src/netedit/GNENet.cpp +++ b/src/netedit/GNENet.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -455,6 +456,10 @@ GNENet::deleteEdge(GNEEdge* edge, GNEUndoList* undoList, bool recomputeConnectio while (edge->getChildAdditionals().size() > 0) { deleteAdditional(edge->getChildAdditionals().front(), undoList); } + // delete TAZSourceSink children + while (edge->getChildTAZSourceSinks().size() > 0) { + deleteTAZSourceSink(edge->getChildTAZSourceSinks().front(), undoList); + } // delete edge child demand elements while (edge->getChildDemandElements().size() > 0) { // special case for embedded routes @@ -675,24 +680,37 @@ GNENet::deleteCrossing(GNECrossing* crossing, GNEUndoList* undoList) { void GNENet::deleteAdditional(GNEAdditional* additional, GNEUndoList* undoList) { undoList->begin(GUIIcon::MODEDELETE, TL("delete ") + additional->getTagStr()); - // remove all demand element children of this additional deleteDemandElement this function recursively + // remove all demand element children while (additional->getChildDemandElements().size() > 0) { deleteDemandElement(additional->getChildDemandElements().front(), undoList); } - // remove all generic data children of this additional deleteGenericData this function recursively + // remove all generic data children while (additional->getChildGenericDatas().size() > 0) { deleteGenericData(additional->getChildGenericDatas().front(), undoList); } - // remove all additional children of this additional calling this function recursively + // remove all additional children while (additional->getChildAdditionals().size() > 0) { deleteAdditional(additional->getChildAdditionals().front(), undoList); } + // remove all TAZSourceSinks children + while (additional->getChildTAZSourceSinks().size() > 0) { + deleteTAZSourceSink(additional->getChildTAZSourceSinks().front(), undoList); + } // remove additional undoList->add(new GNEChange_Additional(additional, false), true); undoList->end(); } +void +GNENet::deleteTAZSourceSink(GNETAZSourceSink* TAZSourceSink, GNEUndoList* undoList) { + undoList->begin(GUIIcon::MODEDELETE, TL("delete ") + TAZSourceSink->getTagStr()); + // remove additional + undoList->add(new GNEChange_TAZSourceSink(TAZSourceSink, false), true); + undoList->end(); +} + + void GNENet::deleteDemandElement(GNEDemandElement* demandElement, GNEUndoList* undoList) { // check that default VTypes aren't removed diff --git a/src/netedit/GNENet.h b/src/netedit/GNENet.h index a1328f468244..b49fd4da67d0 100644 --- a/src/netedit/GNENet.h +++ b/src/netedit/GNENet.h @@ -189,11 +189,17 @@ class GNENet : public GUIGlObject { void deleteCrossing(GNECrossing* crossing, GNEUndoList* undoList); /**@brief remove additional - * @param[in] additional The Shape to be removed + * @param[in] additional The additional to be removed * @param[in] undoList The undolist in which to mark changes */ void deleteAdditional(GNEAdditional* additional, GNEUndoList* undoList); + /**@brief remove TAZSourceSink + * @param[in] TAZSourceSink The TAZSourceSink to be removed + * @param[in] undoList The undolist in which to mark changes + */ + void deleteTAZSourceSink(GNETAZSourceSink* TAZSourceSink, GNEUndoList* undoList); + /**@brief remove demand element * @param[in] demandElement The Shape to be removed * @param[in] undoList The undolist in which to mark changes diff --git a/src/netedit/elements/GNEHierarchicalElement.cpp b/src/netedit/elements/GNEHierarchicalElement.cpp index 01ab272dba21..91d9a623c036 100644 --- a/src/netedit/elements/GNEHierarchicalElement.cpp +++ b/src/netedit/elements/GNEHierarchicalElement.cpp @@ -97,6 +97,9 @@ GNEHierarchicalElement::getAllHierarchicalElements() const { for (const auto& element : getChildAdditionals()) { result.push_back(element); } + for (const auto& element : getChildTAZSourceSinks()) { + result.push_back(element); + } for (const auto& element : getChildDemandElements()) { result.push_back(element); } diff --git a/src/netedit/elements/additional/GNEAdditionalHandler.cpp b/src/netedit/elements/additional/GNEAdditionalHandler.cpp index c99cce783a8d..05152482b15c 100644 --- a/src/netedit/elements/additional/GNEAdditionalHandler.cpp +++ b/src/netedit/elements/additional/GNEAdditionalHandler.cpp @@ -1403,7 +1403,7 @@ GNEAdditionalHandler::buildTAZSource(const CommonXMLStructure::SumoBaseObject* s // declare TAZ Source GNEAdditional* existentTAZSource = nullptr; // first check if already exist a TAZ Source for the given edge and TAZ - for (auto it = edge->getChildAdditionals().begin(); (it != edge->getChildAdditionals().end()) && !existentTAZSource; it++) { + for (auto it = edge->getChildTAZSourceSinks().begin(); (it != edge->getChildTAZSourceSinks().end()) && !existentTAZSource; it++) { if (((*it)->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) && ((*it)->getParentAdditionals().front() == TAZ)) { existentTAZSource = (*it); } @@ -1452,7 +1452,7 @@ GNEAdditionalHandler::buildTAZSink(const CommonXMLStructure::SumoBaseObject* sum // declare TAZ Sink GNEAdditional* existentTAZSink = nullptr; // first check if already exist a TAZ Sink for the given edge and TAZ - for (auto it = edge->getChildAdditionals().begin(); (it != edge->getChildAdditionals().end()) && !existentTAZSink; it++) { + for (auto it = edge->getChildTAZSourceSinks().begin(); (it != edge->getChildTAZSourceSinks().end()) && !existentTAZSink; it++) { if (((*it)->getTagProperty().getTag() == SUMO_TAG_TAZSINK) && ((*it)->getParentAdditionals().front() == TAZ)) { existentTAZSink = (*it); } diff --git a/src/netedit/elements/additional/GNETAZ.cpp b/src/netedit/elements/additional/GNETAZ.cpp index 7684543013fa..08fc392ee674 100644 --- a/src/netedit/elements/additional/GNETAZ.cpp +++ b/src/netedit/elements/additional/GNETAZ.cpp @@ -168,7 +168,7 @@ GNETAZ::writeAdditional(OutputDevice& device) const { device.writeAttr(SUMO_ATTR_COLOR, getShapeColor()); // sort all Source/Sinks by ID std::map, GNEAdditional*> sortedSourceSinks; - for (const auto& sourceSink : getChildAdditionals()) { + for (const auto& sourceSink : getChildTAZSourceSinks()) { sortedSourceSinks[std::make_pair(sourceSink->getAttribute(SUMO_ATTR_EDGE), sourceSink->getTagProperty().getTag())] = sourceSink; } // write all TAZ Source/sinks @@ -443,8 +443,8 @@ GNETAZ::getAttribute(SumoXMLAttr key) const { return toString(myFill); case SUMO_ATTR_EDGES: { std::vector edgeIDs; - for (const auto& TAZChild : getChildAdditionals()) { - edgeIDs.push_back(TAZChild->getAttribute(SUMO_ATTR_EDGE)); + for (const auto& TAZSourceSink : getChildTAZSourceSinks()) { + edgeIDs.push_back(TAZSourceSink->getAttribute(SUMO_ATTR_EDGE)); } return toString(edgeIDs); } @@ -617,9 +617,9 @@ GNETAZ::updateTAZStatistic() { int numberOfSources = 0; int numberOfSinks = 0; // iterate over child additional - for (const auto& TAZChild : getChildAdditionals()) { - if (TAZChild->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { - const double weight = TAZChild->getAttributeDouble(SUMO_ATTR_WEIGHT); + for (const auto& TAZSourceSink : getChildTAZSourceSinks()) { + if (TAZSourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { + const double weight = TAZSourceSink->getAttributeDouble(SUMO_ATTR_WEIGHT); // check max Weight if ((myMaxWeightSource == INVALID_DOUBLE) || (myMaxWeightSource < weight)) { myMaxWeightSource = weight; @@ -632,8 +632,8 @@ GNETAZ::updateTAZStatistic() { myAverageWeightSource += weight; // update number of sources numberOfSources++; - } else if (TAZChild->getTagProperty().getTag() == SUMO_TAG_TAZSINK) { - const double weight = TAZChild->getAttributeDouble(SUMO_ATTR_WEIGHT); + } else if (TAZSourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSINK) { + const double weight = TAZSourceSink->getAttributeDouble(SUMO_ATTR_WEIGHT); // check max Weight if ((myMaxWeightSink == INVALID_DOUBLE) || myMaxWeightSink < weight) { myMaxWeightSink = weight; diff --git a/src/netedit/elements/network/GNEEdge.cpp b/src/netedit/elements/network/GNEEdge.cpp index 85f34c39f546..b209bba1b52a 100644 --- a/src/netedit/elements/network/GNEEdge.cpp +++ b/src/netedit/elements/network/GNEEdge.cpp @@ -1019,9 +1019,9 @@ GNEEdge::clearGNEConnections() { int GNEEdge::getRouteProbeRelativePosition(GNERouteProbe* routeProbe) const { std::vector routeProbes; - for (auto i : getChildAdditionals()) { - if (i->getTagProperty().getTag() == routeProbe->getTagProperty().getTag()) { - routeProbes.push_back(i); + for (const auto &additional : getChildAdditionals()) { + if (additional->getTagProperty().getTag() == routeProbe->getTagProperty().getTag()) { + routeProbes.push_back(additional); } } // return index of routeProbe in routeProbes vector @@ -2910,18 +2910,10 @@ void GNEEdge::drawTAZElements(const GUIVisualizationSettings& s) const { // first check if draw TAZ Elements is enabled if (myNet->getViewNet()->getNetworkViewOptions().showTAZElements()) { - std::vector TAZSourceSinks; - // get all TAZ source/sinks vinculated with this edge - for (const auto& additional : getChildAdditionals()) { - if ((additional->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) || - (additional->getTagProperty().getTag() == SUMO_TAG_TAZSINK)) { - TAZSourceSinks.push_back(additional); - } - } - if (TAZSourceSinks.size() > 0) { + if (getChildTAZSourceSinks().size() > 0) { // check if TAZ Source/sink is selected bool selected = false; - for (const auto& TAZSourceSink : TAZSourceSinks) { + for (const auto& TAZSourceSink : getChildTAZSourceSinks()) { if (TAZSourceSink->isAttributeCarrierSelected()) { selected = true; } diff --git a/src/netedit/elements/network/GNENetworkElement.cpp b/src/netedit/elements/network/GNENetworkElement.cpp index a2cb3980a6fe..9ceea4cd13ae 100644 --- a/src/netedit/elements/network/GNENetworkElement.cpp +++ b/src/netedit/elements/network/GNENetworkElement.cpp @@ -280,7 +280,7 @@ GNENetworkElement::setNetworkElementID(const std::string& newID) { // set microsim ID setMicrosimID(newID); // enable save add elements if this network element has children - if (getChildAdditionals().size() > 0) { + if ((getChildAdditionals().size() > 0) || (getChildTAZSourceSinks().size() > 0)) { myNet->getSavingStatus()->requireSaveAdditionals(); } // enable save demand elements if this network element has children diff --git a/src/netedit/frames/GNEElementTree.cpp b/src/netedit/frames/GNEElementTree.cpp index 09502116c134..b0a6116c11b4 100644 --- a/src/netedit/frames/GNEElementTree.cpp +++ b/src/netedit/frames/GNEElementTree.cpp @@ -835,6 +835,10 @@ GNEElementTree::showHierarchicalElementChildren(GNEHierarchicalElement* HE, FXTr for (const auto& additional : edge->getChildAdditionals()) { showHierarchicalElementChildren(additional, edgeItem); } + // insert child TAZSourceSink + for (const auto& TAZSourceSink : edge->getChildTAZSourceSinks()) { + showHierarchicalElementChildren(TAZSourceSink, edgeItem); + } // insert child demand elements for (const auto& demandElement : edge->getChildDemandElements()) { showHierarchicalElementChildren(demandElement, edgeItem); @@ -931,6 +935,10 @@ GNEElementTree::showHierarchicalElementChildren(GNEHierarchicalElement* HE, FXTr showHierarchicalElementChildren(additional, treeItem); } } + // insert additional children + for (const auto& TAZSourceSink : HE->getChildTAZSourceSinks()) { + showHierarchicalElementChildren(TAZSourceSink, treeItem); + } // insert child demand elements for (const auto& demandElement : HE->getChildDemandElements()) { showHierarchicalElementChildren(demandElement, treeItem); From abab2fff8fa335052e698ccb37d4e4b86644cc0b Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Wed, 22 Jan 2025 10:35:24 +0100 Subject: [PATCH 065/116] Fixed problem drawing TAZSourceSinks. Refs #16039 --- src/netedit/frames/network/GNETAZFrame.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/netedit/frames/network/GNETAZFrame.cpp b/src/netedit/frames/network/GNETAZFrame.cpp index 97e1cb9c5eb0..fec883c1576a 100644 --- a/src/netedit/frames/network/GNETAZFrame.cpp +++ b/src/netedit/frames/network/GNETAZFrame.cpp @@ -263,8 +263,8 @@ GNETAZFrame::CurrentTAZ::refreshTAZEdges() { myEditedTAZ->updateTAZStatistic(); myTAZFrameParent->myTAZCommonStatistics->updateStatistics(); // iterate over child TAZElements and create TAZEdges - for (const auto& TAZElement : myEditedTAZ->getChildAdditionals()) { - addTAZChild(dynamic_cast(TAZElement)); + for (const auto& TAZSourceSink : myEditedTAZ->getChildTAZSourceSinks()) { + addTAZChild(TAZSourceSink); } // update colors after add all edges for (auto& TAZEdgeColor : myTAZEdgeColors) { @@ -376,7 +376,7 @@ GNETAZFrame::TAZCommonStatistics::updateStatistics() { // declare ostringstream for statistics std::ostringstream information; information - << TL("- Number of edges: ") << toString(myTAZFrameParent->myCurrentTAZ->getTAZ()->getChildAdditionals().size() / 2) << "\n" + << TL("- Number of edges: ") << toString(myTAZFrameParent->myCurrentTAZ->getTAZ()->getChildTAZSourceSinks().size() / 2) << "\n" << TL("- Min source: ") << myTAZFrameParent->myCurrentTAZ->getTAZ()->getAttribute(GNE_ATTR_MIN_SOURCE) << "\n" << TL("- Max source: ") << myTAZFrameParent->myCurrentTAZ->getTAZ()->getAttribute(GNE_ATTR_MAX_SOURCE) << "\n" << TL("- Average source: ") << myTAZFrameParent->myCurrentTAZ->getTAZ()->getAttribute(GNE_ATTR_AVERAGE_SOURCE) << "\n" @@ -801,7 +801,7 @@ GNETAZFrame::TAZChildDefaultParameters::onCmdSetZeroFringeProbabilities(FXObject // check if we're editing a single TAZ or all TAZs if (myTAZFrameParent->myCurrentTAZ->getTAZ() != nullptr) { // iterate over source/sinks - for (const auto& TAZSourceSink : myTAZFrameParent->myCurrentTAZ->getTAZ()->getChildAdditionals()) { + for (const auto& TAZSourceSink : myTAZFrameParent->myCurrentTAZ->getTAZ()->getChildTAZSourceSinks()) { if (TAZSourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { // set sink probability to 0 for all edges that have no predecessor if (!TAZSourceSink->getParentEdges().front()->hasSuccessors() && @@ -822,7 +822,7 @@ GNETAZFrame::TAZChildDefaultParameters::onCmdSetZeroFringeProbabilities(FXObject // iterate over all TAZs for (const auto& TAZ : myTAZFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getAdditionals().at(SUMO_TAG_TAZ)) { // iterate over source/sinks - for (const auto& TAZSourceSink : TAZ.second->getChildAdditionals()) { + for (const auto& TAZSourceSink : TAZ.second->getChildTAZSourceSinks()) { if (TAZSourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { // set sink probability to 0 for all edges that have no predecessor if (!TAZSourceSink->getParentEdges().front()->hasSuccessors() && From 79f2c14e66d9c889cc75851652e67262f0ae5883 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Wed, 22 Jan 2025 12:31:41 +0100 Subject: [PATCH 066/116] added test refs #21, #16055 --- .../geojson/all-attributes/errors.polyconvert | 0 .../geojson/all-attributes/input.geojson | 1209 +++++++++++++++++ .../all-attributes/options.polyconvert | 2 + .../geojson/all-attributes/output.polyconvert | 5 + .../geojson/all-attributes/pois.polyconvert | 204 +++ .../import/geojson/testsuite.polyconvert | 3 + 6 files changed, 1423 insertions(+) create mode 100644 tests/polyconvert/import/geojson/all-attributes/errors.polyconvert create mode 100644 tests/polyconvert/import/geojson/all-attributes/input.geojson create mode 100644 tests/polyconvert/import/geojson/all-attributes/options.polyconvert create mode 100644 tests/polyconvert/import/geojson/all-attributes/output.polyconvert create mode 100644 tests/polyconvert/import/geojson/all-attributes/pois.polyconvert diff --git a/tests/polyconvert/import/geojson/all-attributes/errors.polyconvert b/tests/polyconvert/import/geojson/all-attributes/errors.polyconvert new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/polyconvert/import/geojson/all-attributes/input.geojson b/tests/polyconvert/import/geojson/all-attributes/input.geojson new file mode 100644 index 000000000000..c7c1e8d36188 --- /dev/null +++ b/tests/polyconvert/import/geojson/all-attributes/input.geojson @@ -0,0 +1,1209 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + 13.531263, + 52.429818 + ], + [ + 13.531081, + 52.42994 + ], + [ + 13.531059, + 52.429955 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "-142575691#0", + "name": "Magnusstra\u00dfe" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529194, + 52.429342 + ], + [ + 13.529197, + 52.429338 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "128643753#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529359, + 52.429246 + ], + [ + 13.529367, + 52.429243 + ], + [ + 13.529504, + 52.429137 + ], + [ + 13.529751, + 52.42898 + ], + [ + 13.529906, + 52.428872 + ], + [ + 13.530158, + 52.428696 + ], + [ + 13.530212, + 52.428659 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "128643753#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530996, + 52.429919 + ], + [ + 13.531018, + 52.429904 + ], + [ + 13.5312, + 52.429783 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "142575691#0", + "name": "Magnusstra\u00dfe" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529488, + 52.429606 + ], + [ + 13.529442, + 52.429611 + ], + [ + 13.529393, + 52.429624 + ], + [ + 13.529346, + 52.429643 + ], + [ + 13.529291, + 52.429676 + ], + [ + 13.529244, + 52.429713 + ], + [ + 13.528818, + 52.430215 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "142575692#0", + "name": "Max-Born-Stra\u00dfe" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.52876, + 52.430283 + ], + [ + 13.528648, + 52.430415 + ], + [ + 13.528173, + 52.430977 + ], + [ + 13.528144, + 52.431011 + ], + [ + 13.527969, + 52.431218 + ], + [ + 13.527258, + 52.432044 + ], + [ + 13.527209, + 52.432107 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "142575692#2", + "name": "Max-Born-Stra\u00dfe" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.527038, + 52.432033 + ], + [ + 13.527098, + 52.431975 + ], + [ + 13.527535, + 52.431494 + ], + [ + 13.528014, + 52.43092 + ], + [ + 13.528453, + 52.430403 + ], + [ + 13.528573, + 52.430259 + ], + [ + 13.528637, + 52.430187 + ], + [ + 13.529183, + 52.429535 + ], + [ + 13.529211, + 52.429501 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "142575693#0", + "name": "Max-Born-Stra\u00dfe" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.526873, + 52.428795 + ], + [ + 13.527033, + 52.428821 + ], + [ + 13.527555, + 52.428912 + ], + [ + 13.528005, + 52.428987 + ], + [ + 13.528416, + 52.429068 + ], + [ + 13.528584, + 52.429107 + ], + [ + 13.528989, + 52.42921 + ], + [ + 13.529207, + 52.429269 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308542#0", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529334, + 52.429308 + ], + [ + 13.529597, + 52.429391 + ], + [ + 13.529894, + 52.429501 + ], + [ + 13.530053, + 52.429567 + ], + [ + 13.530089, + 52.429582 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308542#2", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530163, + 52.429614 + ], + [ + 13.530381, + 52.429712 + ], + [ + 13.530835, + 52.429928 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308542#4", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530887, + 52.429952 + ], + [ + 13.530889, + 52.429953 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308542#5", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.53104, + 52.430023 + ], + [ + 13.531592, + 52.430283 + ], + [ + 13.531904, + 52.430406 + ], + [ + 13.532542, + 52.430632 + ], + [ + 13.532598, + 52.430652 + ], + [ + 13.532799, + 52.430723 + ], + [ + 13.532945, + 52.430778 + ], + [ + 13.533173, + 52.430863 + ], + [ + 13.533415, + 52.430973 + ], + [ + 13.533692, + 52.431138 + ], + [ + 13.53417, + 52.431442 + ], + [ + 13.534228, + 52.431478 + ], + [ + 13.534696, + 52.431773 + ], + [ + 13.534954, + 52.431936 + ], + [ + 13.535042, + 52.431992 + ], + [ + 13.535196, + 52.432089 + ], + [ + 13.535246, + 52.43212 + ], + [ + 13.53537, + 52.432198 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308542#6", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.531253, + 52.430365 + ], + [ + 13.531205, + 52.430345 + ], + [ + 13.530993, + 52.430257 + ], + [ + 13.530822, + 52.430176 + ], + [ + 13.530684, + 52.430111 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#0", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530626, + 52.430083 + ], + [ + 13.530106, + 52.429839 + ], + [ + 13.529965, + 52.429774 + ], + [ + 13.529951, + 52.429768 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#1", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529875, + 52.429733 + ], + [ + 13.529638, + 52.429623 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#3", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529212, + 52.429428 + ], + [ + 13.529169, + 52.42941 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#7", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529115, + 52.429391 + ], + [ + 13.529097, + 52.429386 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#8", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.52901, + 52.42936 + ], + [ + 13.52891, + 52.42933 + ], + [ + 13.528511, + 52.429231 + ], + [ + 13.528346, + 52.429198 + ], + [ + 13.528068, + 52.429145 + ], + [ + 13.527661, + 52.429077 + ], + [ + 13.527149, + 52.428992 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "143308546#9", + "name": "Rudower Chaussee" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.526465, + 52.432491 + ], + [ + 13.526564, + 52.432429 + ], + [ + 13.526902, + 52.432216 + ], + [ + 13.527014, + 52.432142 + ], + [ + 13.527108, + 52.432062 + ], + [ + 13.527135, + 52.432033 + ], + [ + 13.527161, + 52.432001 + ], + [ + 13.528084, + 52.430945 + ], + [ + 13.528524, + 52.430409 + ], + [ + 13.529153, + 52.429676 + ], + [ + 13.529198, + 52.429632 + ], + [ + 13.529256, + 52.429584 + ], + [ + 13.529298, + 52.429566 + ], + [ + 13.52937, + 52.429541 + ], + [ + 13.529469, + 52.429524 + ], + [ + 13.529491, + 52.429524 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "158236729#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529693, + 52.429529 + ], + [ + 13.5297, + 52.42953 + ], + [ + 13.529817, + 52.429557 + ], + [ + 13.530084, + 52.429659 + ], + [ + 13.530349, + 52.429788 + ], + [ + 13.530604, + 52.429908 + ], + [ + 13.530672, + 52.429944 + ], + [ + 13.530753, + 52.429987 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "158236729#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.535316, + 52.432363 + ], + [ + 13.535214, + 52.432295 + ], + [ + 13.53509, + 52.432219 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "206889079#5", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.535087, + 52.432217 + ], + [ + 13.53462, + 52.431912 + ], + [ + 13.533942, + 52.431478 + ], + [ + 13.533724, + 52.431339 + ], + [ + 13.533484, + 52.431187 + ], + [ + 13.533213, + 52.43103 + ], + [ + 13.532996, + 52.430927 + ], + [ + 13.532679, + 52.430809 + ], + [ + 13.532201, + 52.43062 + ], + [ + 13.531519, + 52.430363 + ], + [ + 13.531118, + 52.430201 + ], + [ + 13.530787, + 52.430044 + ], + [ + 13.530779, + 52.43004 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "206889079#6", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530721, + 52.430011 + ], + [ + 13.530586, + 52.429944 + ], + [ + 13.530317, + 52.429813 + ], + [ + 13.530104, + 52.429709 + ], + [ + 13.530037, + 52.429677 + ], + [ + 13.529804, + 52.429584 + ], + [ + 13.529707, + 52.42956 + ], + [ + 13.529694, + 52.429559 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "206889079#7", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530811, + 52.430018 + ], + [ + 13.530832, + 52.43003 + ], + [ + 13.531145, + 52.430177 + ], + [ + 13.531543, + 52.430348 + ], + [ + 13.532511, + 52.43071 + ], + [ + 13.53272, + 52.430782 + ], + [ + 13.532933, + 52.430872 + ], + [ + 13.533102, + 52.430941 + ], + [ + 13.533227, + 52.431 + ], + [ + 13.533415, + 52.431103 + ], + [ + 13.533576, + 52.431202 + ], + [ + 13.533961, + 52.431449 + ], + [ + 13.535052, + 52.432145 + ], + [ + 13.535126, + 52.432195 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "220198808#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.535126, + 52.432195 + ], + [ + 13.535252, + 52.432271 + ], + [ + 13.53536, + 52.432338 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "220198808#2", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.52949, + 52.42955 + ], + [ + 13.529486, + 52.42955 + ], + [ + 13.529383, + 52.429567 + ], + [ + 13.52929, + 52.4296 + ], + [ + 13.529233, + 52.429645 + ], + [ + 13.528573, + 52.430409 + ], + [ + 13.528112, + 52.430953 + ], + [ + 13.527197, + 52.432018 + ], + [ + 13.527171, + 52.432047 + ], + [ + 13.527141, + 52.432076 + ], + [ + 13.527043, + 52.432156 + ], + [ + 13.526926, + 52.432232 + ], + [ + 13.526592, + 52.432444 + ], + [ + 13.526369, + 52.432586 + ], + [ + 13.526163, + 52.432723 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "220198810#1", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.528864, + 52.430238 + ], + [ + 13.52899, + 52.430198 + ], + [ + 13.529142, + 52.430143 + ], + [ + 13.529435, + 52.429979 + ], + [ + 13.529783, + 52.429827 + ], + [ + 13.52984, + 52.429794 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "312889498", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.528432, + 52.429775 + ], + [ + 13.528515, + 52.429657 + ], + [ + 13.52872, + 52.429545 + ], + [ + 13.528987, + 52.429423 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "328287315", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.53072, + 52.430047 + ], + [ + 13.530722, + 52.430046 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096580#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530804, + 52.429988 + ], + [ + 13.530806, + 52.429987 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096580#3", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.529986, + 52.429703 + ], + [ + 13.530002, + 52.429691 + ], + [ + 13.53004, + 52.429661 + ], + [ + 13.530057, + 52.429648 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096589#0", + "name": "" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + 13.530195, + 52.429553 + ], + [ + 13.530203, + 52.429546 + ], + [ + 13.530224, + 52.42952 + ] + ], + "type": "LineString" + }, + "properties": { + "element": "edge", + "id": "81096589#3", + "name": "" + }, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} diff --git a/tests/polyconvert/import/geojson/all-attributes/options.polyconvert b/tests/polyconvert/import/geojson/all-attributes/options.polyconvert new file mode 100644 index 000000000000..f4aaa77440e5 --- /dev/null +++ b/tests/polyconvert/import/geojson/all-attributes/options.polyconvert @@ -0,0 +1,2 @@ +-v --geojson-files input.geojson -o pois.poi.xml --all-attributes + diff --git a/tests/polyconvert/import/geojson/all-attributes/output.polyconvert b/tests/polyconvert/import/geojson/all-attributes/output.polyconvert new file mode 100644 index 000000000000..5dfb12f033ff --- /dev/null +++ b/tests/polyconvert/import/geojson/all-attributes/output.polyconvert @@ -0,0 +1,5 @@ +Parsing from geojson-file 'input.geojson' ... +Available fields: element id name + done. + done. +Success. diff --git a/tests/polyconvert/import/geojson/all-attributes/pois.polyconvert b/tests/polyconvert/import/geojson/all-attributes/pois.polyconvert new file mode 100644 index 000000000000..9ce0aace9912 --- /dev/null +++ b/tests/polyconvert/import/geojson/all-attributes/pois.polyconvert @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/polyconvert/import/geojson/testsuite.polyconvert b/tests/polyconvert/import/geojson/testsuite.polyconvert index 4b0ecc216189..f7f1e5994204 100644 --- a/tests/polyconvert/import/geojson/testsuite.polyconvert +++ b/tests/polyconvert/import/geojson/testsuite.polyconvert @@ -1,2 +1,5 @@ # geojson comes without crs and should be interpreted as lon,lat no_crs + +# import all attributes +all-attributes From 0a6521b7964420fa917e71529d3f446873565dfc Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Wed, 22 Jan 2025 12:32:03 +0100 Subject: [PATCH 067/116] can now import additional geojson attributes. #16055 --- src/polyconvert/PCLoaderArcView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/polyconvert/PCLoaderArcView.cpp b/src/polyconvert/PCLoaderArcView.cpp index e42326d85a93..2c3ce837d01a 100644 --- a/src/polyconvert/PCLoaderArcView.cpp +++ b/src/polyconvert/PCLoaderArcView.cpp @@ -310,7 +310,7 @@ PCLoaderArcView::load(const std::string& file, OptionsCont& oc, PCPolyContainer& WRITE_WARNINGF(TL("Unsupported shape type occurred (id='%')."), id); break; } - if (oc.getBool("shapefile.add-param")) { + if (oc.getBool("shapefile.add-param") || oc.getBool("all-attributes")) { for (std::vector::const_iterator it = parCont.begin(); it != parCont.end(); ++it) { OGRFeatureDefn* poFDefn = poLayer->GetLayerDefn(); for (int iField = 0; iField < poFDefn->GetFieldCount(); iField++) { From 13783e487a89b4da7ab916e69c8924f37c5b11d2 Mon Sep 17 00:00:00 2001 From: Mirko Barthauer Date: Wed, 22 Jan 2025 10:21:25 +0000 Subject: [PATCH 068/116] Translated using Weblate (Italian) Currently translated at 65.1% (1697 of 2606 strings) Translation: Eclipse SUMO/Applications Translate-URL: https://hosted.weblate.org/projects/eclipse-sumo/applications/it/ --- data/po/it_sumo.po | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/data/po/it_sumo.po b/data/po/it_sumo.po index 436e90a57fa8..a547ca157ea0 100644 --- a/data/po/it_sumo.po +++ b/data/po/it_sumo.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: sumo\n" "Report-Msgid-Bugs-To: sumo-dev@eclipse.org\n" "POT-Creation-Date: 2025-01-06 11:22+0100\n" -"PO-Revision-Date: 2025-01-20 12:30+0000\n" +"PO-Revision-Date: 2025-01-22 12:13+0000\n" "Last-Translator: Mirko Barthauer \n" "Language-Team: Italian \n" @@ -3037,6 +3037,8 @@ msgid "" "Vehicle '%' is inserted too fast and will violate the speed limit on a lane " "'%'." msgstr "" +"Il veicolo '%' viene inserito con una velocità troppo elevata e quindi " +"violerà il limite di velocità della corsia '%'." #: src/microsim/MSLane.cpp:1098 msgid "" @@ -3060,19 +3062,20 @@ msgstr "collisione" #: src/microsim/MSLane.cpp:2019 msgid "Vehicle '%'; % with vehicle '%" -msgstr "" +msgstr "Veicolo '%'; % con veicolo '%" #: src/microsim/MSLane.cpp:2076 msgid "Teleporting vehicle '%'; % with vehicle '%" -msgstr "" +msgstr "Teletrasporto di veicolo '%', % con veicolo '%" #: src/microsim/MSLane.cpp:2081 msgid "Removing % participants: vehicle '%', vehicle '%" -msgstr "" +msgstr "Rimozione di % participanti: veicolo '%', veicolo '%" #: src/microsim/MSLane.cpp:2094 msgid "Keeping remote-controlled % participants: vehicle '%', vehicle '%" msgstr "" +"Mantenuti % participanti controllati esternamente: veicolo '%', veicolo '%" #: src/microsim/MSLane.cpp:2096 msgid "" @@ -3128,14 +3131,19 @@ msgstr "" #: src/microsim/MSLane.cpp:2263 msgid "Teleporting vehicle '%'; beyond end of lane, target lane='%', time=%." msgstr "" +"Teletrasporto di veicolo '%'; oltre la fine della corsia, corsia di " +"destinazione='%' alle ore %." #: src/microsim/MSLane.cpp:2271 msgid "Removing vehicle '%' after earlier collision, lane='%', time=%." msgstr "" +"Rimozione di veicolo '%' dopo una previa collisione, corsia='%' alle ore %." #: src/microsim/MSLane.cpp:2276 msgid "Teleporting vehicle '%' after earlier collision, lane='%', time=%." msgstr "" +"Teletrasporto di veicolo '%' dopo una previa collisione, corsia='%' alle ore " +"%." #: src/microsim/MSLane.cpp:2797 msgid "" @@ -3449,6 +3457,8 @@ msgid "" "The attribute departPos is no longer supported for walks, please use the " "person attribute, the arrivalPos of the previous step or explicit stops." msgstr "" +"L'attributo departPos non si usa più per dei cammini. Invece usa l'attributo " +"person, quello arrivalPos del passo antecedente o fermate esplicite." #: src/microsim/MSRouteHandler.cpp:1508 msgid "Ignoring arrivalPos for % because it is outside the given stop '%'." @@ -3579,6 +3589,8 @@ msgid "" "Vehicle '%' moved by TraCI from % to % (dist %) with implied speed of % " "(exceeding maximum speed %). time=%." msgstr "" +"Mosso veicolo '%'attraverso TraCI da % a % (distanza %) con una velocità " +"implicita di % (eccedendo la velocità massima di %) alle ore %." #: src/microsim/MSVehicle.cpp:1732 msgid "Vehicle '%' aborts joining after extension of %s at time %." @@ -3610,6 +3622,8 @@ msgid "" "Vehicle '%' performs emergency stop at the end of lane '%'% (decel=%, offset=" "%), time=%." msgstr "" +"Il veicolo '%' effettua una frenata d'urgenza alle fine della corsia '%'% (" +"decel=%, offset=%) alle ore %." #: src/microsim/MSVehicle.cpp:4729 msgid "Unexpected end of opposite lane for vehicle '%' at lane '%', time=%." @@ -3723,12 +3737,16 @@ msgid "" "The number of lanes needs to be specified in the attributes of carFollowing-" "CC with the \"lanesCount\" attribute" msgstr "" +"Il numero di corsie deve essere specificato negli attributi di carFollowing-" +"CC sotto l'attributo \"lanesCount\"" #: src/microsim/cfmodels/MSCFModel_Daniel1.cpp:61 msgid "" "Maximum speed of vehicle '%' is lower than the minimum speed (min: %, max: " "%)." msgstr "" +"La velocità massima del veicolo '%' è inferiore alla velocità minima (min: " +"%, max: %)." #: src/microsim/cfmodels/MSCFModel_Krauss.cpp:58 msgid "Rounding 'sigmaStep' to % for vType '%'" From 635f6dceca5d2b810ec0112cd26b1acaba8a64c7 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Wed, 22 Jan 2025 11:01:21 +0100 Subject: [PATCH 069/116] Now myChildSourceSinks is a hash instead a vector. Refs #16039 --- src/netedit/GNENet.cpp | 4 ++-- src/netedit/changes/GNEChange.h | 4 ++-- src/netedit/elements/GNEHierarchicalElement.cpp | 4 ++-- src/netedit/elements/GNEHierarchicalElement.h | 4 ++-- src/netedit/elements/GNEHierarchicalStructure.cpp | 13 ++++++++----- src/netedit/elements/GNEHierarchicalStructure.h | 10 +++++++--- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/netedit/GNENet.cpp b/src/netedit/GNENet.cpp index 2b4647d84a8e..b2b2a2512a40 100644 --- a/src/netedit/GNENet.cpp +++ b/src/netedit/GNENet.cpp @@ -458,7 +458,7 @@ GNENet::deleteEdge(GNEEdge* edge, GNEUndoList* undoList, bool recomputeConnectio } // delete TAZSourceSink children while (edge->getChildTAZSourceSinks().size() > 0) { - deleteTAZSourceSink(edge->getChildTAZSourceSinks().front(), undoList); + deleteTAZSourceSink(*edge->getChildTAZSourceSinks().begin(), undoList); } // delete edge child demand elements while (edge->getChildDemandElements().size() > 0) { @@ -694,7 +694,7 @@ GNENet::deleteAdditional(GNEAdditional* additional, GNEUndoList* undoList) { } // remove all TAZSourceSinks children while (additional->getChildTAZSourceSinks().size() > 0) { - deleteTAZSourceSink(additional->getChildTAZSourceSinks().front(), undoList); + deleteTAZSourceSink(*additional->getChildTAZSourceSinks().begin(), undoList); } // remove additional undoList->add(new GNEChange_Additional(additional, false), true); diff --git a/src/netedit/changes/GNEChange.h b/src/netedit/changes/GNEChange.h index bfc074e5c782..2b645e4fc162 100644 --- a/src/netedit/changes/GNEChange.h +++ b/src/netedit/changes/GNEChange.h @@ -157,7 +157,7 @@ class GNEChange : public FXObject { for (const auto& additional : myOriginalHierarchicalContainer.getChildren()) { additional->addParentElement(element); } - for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildren()) { + for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildrenHash()) { TAZSourceSink->addParentElement(element); } for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren()) { @@ -206,7 +206,7 @@ class GNEChange : public FXObject { for (const auto& additional : myOriginalHierarchicalContainer.getChildren()) { additional->removeParentElement(element); } - for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildren()) { + for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildrenHash()) { TAZSourceSink->removeParentElement(element); } for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren()) { diff --git a/src/netedit/elements/GNEHierarchicalElement.cpp b/src/netedit/elements/GNEHierarchicalElement.cpp index 91d9a623c036..f2df53cca63e 100644 --- a/src/netedit/elements/GNEHierarchicalElement.cpp +++ b/src/netedit/elements/GNEHierarchicalElement.cpp @@ -194,9 +194,9 @@ GNEHierarchicalElement::getChildAdditionals() const { } -const GNEHierarchicalContainerChildren& +const GNEHierarchicalContainerChildrenHash& GNEHierarchicalElement::getChildTAZSourceSinks() const { - return myHierarchicalStructure.getChildren(); + return myHierarchicalStructure.getChildrenHash(); } diff --git a/src/netedit/elements/GNEHierarchicalElement.h b/src/netedit/elements/GNEHierarchicalElement.h index 4ec84fe9f472..83cd789b0069 100644 --- a/src/netedit/elements/GNEHierarchicalElement.h +++ b/src/netedit/elements/GNEHierarchicalElement.h @@ -124,8 +124,8 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { /// @brief return child additionals const GNEHierarchicalContainerChildren& getChildAdditionals() const; - /// @brief return child TAZSourceSinks - const GNEHierarchicalContainerChildren& getChildTAZSourceSinks() const; + /// @brief return child TAZSourceSinks (Hash) + const GNEHierarchicalContainerChildrenHash& getChildTAZSourceSinks() const; /// @brief return child demand elements const GNEHierarchicalContainerChildren& getChildDemandElements() const; diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index fb38baa28faf..e80637b2e953 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -218,7 +218,7 @@ GNEHierarchicalStructure::addChildElement(GNEAdditional* additional) { template <> void GNEHierarchicalStructure::addChildElement(GNETAZSourceSink* TAZSourceSink) { - myChildSourceSinks.push_back(TAZSourceSink); + myChildSourceSinks.insert(TAZSourceSink); } @@ -280,7 +280,7 @@ GNEHierarchicalStructure::removeChildElement(GNEAdditional* additional) { template <> void GNEHierarchicalStructure::removeChildElement(GNETAZSourceSink* TAZSourceSink) { - auto it = std::find(myChildSourceSinks.begin(), myChildSourceSinks.end(), TAZSourceSink); + auto it = myChildSourceSinks.find(TAZSourceSink); if (it != myChildSourceSinks.end()) { myChildSourceSinks.erase(it); } else { @@ -418,8 +418,8 @@ GNEHierarchicalStructure::getChildren() const { } -template<> const GNEHierarchicalContainerChildren& -GNEHierarchicalStructure::getChildren() const { +template<> const GNEHierarchicalContainerChildrenHash& +GNEHierarchicalStructure::getChildrenHash() const { return myChildSourceSinks; } @@ -462,7 +462,10 @@ GNEHierarchicalStructure::setChildren(const std::vector& newChil template<> void GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildSourceSinks = newChildren; + myChildSourceSinks.clear(); + for (const auto &newChild : newChildren) { + myChildSourceSinks.insert(newChild); + } } diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index b623114d3590..14b37ba17260 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -91,6 +91,10 @@ class GNEHierarchicalStructure { template const GNEHierarchicalContainerChildren& getChildren() const; + /// @brief get childrenHash + template + const GNEHierarchicalContainerChildrenHash& getChildrenHash() const; + /// @brief set children template void setChildren(const std::vector& newChildren); @@ -108,7 +112,7 @@ class GNEHierarchicalStructure { /// @brief parents additionals GNEHierarchicalContainerParents myParentAdditionals; - /// @brief parents additionals + /// @brief parents TAZSourceSinks (Unused, but needed for function addElementInParentsAndChildren) GNEHierarchicalContainerParents myParentTAZSourceSinks; /// @brief parents demand elements @@ -129,8 +133,8 @@ class GNEHierarchicalStructure { /// @brief children additional elements GNEHierarchicalContainerChildren myChildAdditionals; - /// @brief children additional elements - GNEHierarchicalContainerChildren myChildSourceSinks; + /// @brief children TAZSourceSinks elements (hash) + GNEHierarchicalContainerChildrenHash myChildSourceSinks; /// @brief children demand elements GNEHierarchicalContainerChildren myChildDemandElements; From a19dfe07e1f71b893a35585603c0c5ee1bedbe02 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Wed, 22 Jan 2025 11:11:49 +0100 Subject: [PATCH 070/116] Fixed freezing inspecting a TAZ with a big number of Source/sinks. Refs #16039 --- src/netedit/frames/GNEElementTree.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/netedit/frames/GNEElementTree.cpp b/src/netedit/frames/GNEElementTree.cpp index b0a6116c11b4..08ee6999b2ee 100644 --- a/src/netedit/frames/GNEElementTree.cpp +++ b/src/netedit/frames/GNEElementTree.cpp @@ -835,9 +835,14 @@ GNEElementTree::showHierarchicalElementChildren(GNEHierarchicalElement* HE, FXTr for (const auto& additional : edge->getChildAdditionals()) { showHierarchicalElementChildren(additional, edgeItem); } - // insert child TAZSourceSink - for (const auto& TAZSourceSink : edge->getChildTAZSourceSinks()) { - showHierarchicalElementChildren(TAZSourceSink, edgeItem); + // avoid show a high number of TAZSource SInks + if (edge->getChildTAZSourceSinks().size() > 20) { + addListItem(edgeItem, TLF("SourceSinks (%)", toString(edge->getChildTAZSourceSinks().size())), GUIIconSubSys::getIcon(GUIIcon::TAZ), false); + } else { + // insert child TAZSourceSink + for (const auto& TAZSourceSink : edge->getChildTAZSourceSinks()) { + showHierarchicalElementChildren(TAZSourceSink, edgeItem); + } } // insert child demand elements for (const auto& demandElement : edge->getChildDemandElements()) { @@ -935,9 +940,14 @@ GNEElementTree::showHierarchicalElementChildren(GNEHierarchicalElement* HE, FXTr showHierarchicalElementChildren(additional, treeItem); } } - // insert additional children - for (const auto& TAZSourceSink : HE->getChildTAZSourceSinks()) { - showHierarchicalElementChildren(TAZSourceSink, treeItem); + // avoid show a high number of TAZSource SInks + if (HE->getChildTAZSourceSinks().size() > 20) { + addListItem(treeItem, TLF("SourceSinks (%)", toString(HE->getChildTAZSourceSinks().size())), GUIIconSubSys::getIcon(GUIIcon::TAZ), false); + } else { + // insert child TAZSourceSink + for (const auto& TAZSourceSink : HE->getChildTAZSourceSinks()) { + showHierarchicalElementChildren(TAZSourceSink, treeItem); + } } // insert child demand elements for (const auto& demandElement : HE->getChildDemandElements()) { From e54cbe3cd4de4c56d51d5d50c2dbe4c47ee7db4d Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Wed, 22 Jan 2025 13:46:31 +0100 Subject: [PATCH 071/116] Minor update in GNEHierarchicalStructure. Refs #16039 --- src/netedit/elements/GNEHierarchicalStructure.cpp | 7 ++----- src/netedit/elements/GNEHierarchicalStructure.h | 6 +++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index e80637b2e953..8b931305243e 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -461,11 +461,8 @@ GNEHierarchicalStructure::setChildren(const std::vector& newChil template<> void -GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { - myChildSourceSinks.clear(); - for (const auto &newChild : newChildren) { - myChildSourceSinks.insert(newChild); - } +GNEHierarchicalStructure::setChildrenHash(const std::unordered_set& newChildren) { + myChildSourceSinks = newChildren; } diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index 14b37ba17260..388e2f906567 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -91,7 +91,7 @@ class GNEHierarchicalStructure { template const GNEHierarchicalContainerChildren& getChildren() const; - /// @brief get childrenHash + /// @brief get children hash template const GNEHierarchicalContainerChildrenHash& getChildrenHash() const; @@ -99,6 +99,10 @@ class GNEHierarchicalStructure { template void setChildren(const std::vector& newChildren); + /// @brief set children hash + template + void setChildrenHash(const std::unordered_set& newChildren); + private: /// @brief parents junctions GNEHierarchicalContainerParents myParentJunctions; From 780badc4db97d9e742191801975c6d0cf2adeacb Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Wed, 22 Jan 2025 15:58:39 +0100 Subject: [PATCH 072/116] Updated GNEHierarchicalStructure. Refs #16039 --- src/netedit/elements/GNEAttributeCarrier.cpp | 18 ++++++++++++++++-- .../GNEHierarchicalContainerChildrenHash.h | 8 ++++---- src/netedit/elements/GNEHierarchicalElement.h | 2 +- .../elements/GNEHierarchicalStructure.cpp | 14 +++++++------- .../elements/GNEHierarchicalStructure.h | 4 ++-- .../elements/additional/GNEAdditional.cpp | 4 ++-- 6 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/netedit/elements/GNEAttributeCarrier.cpp b/src/netedit/elements/GNEAttributeCarrier.cpp index 8fc2afea9a31..06843c87f57a 100644 --- a/src/netedit/elements/GNEAttributeCarrier.cpp +++ b/src/netedit/elements/GNEAttributeCarrier.cpp @@ -385,8 +385,9 @@ GNEAttributeCarrier::parse(const std::string& value) { template<> std::vector GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { // Declare string vector - std::vector edgeIds = GNEAttributeCarrier::parse > (value); + const auto edgeIds = GNEAttributeCarrier::parse > (value); std::vector parsedEdges; + parsedEdges.reserve(edgeIds.size()); // Iterate over edges IDs, retrieve Edges and add it into parsedEdges for (const auto& edgeID : edgeIds) { GNEEdge* retrievedEdge = net->getAttributeCarriers()->retrieveEdge(edgeID, false); @@ -401,11 +402,18 @@ GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { } +template<> GNEHierarchicalContainerChildren +GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { + return GNEHierarchicalContainerChildren(parse >(net, value)); +} + + template<> std::vector GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { // Declare string vector - std::vector laneIds = GNEAttributeCarrier::parse > (value); + const auto laneIds = GNEAttributeCarrier::parse > (value); std::vector parsedLanes; + parsedLanes.reserve(laneIds.size()); // Iterate over lanes IDs, retrieve Lanes and add it into parsedLanes for (const auto& laneID : laneIds) { GNELane* retrievedLane = net->getAttributeCarriers()->retrieveLane(laneID, false); @@ -420,6 +428,12 @@ GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { } +template<> GNEHierarchicalContainerChildren +GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { + return GNEHierarchicalContainerChildren(parse >(net, value)); +} + + template<> std::string GNEAttributeCarrier::parseIDs(const std::vector& ACs) { // obtain ID's of edges and return their join diff --git a/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h b/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h index 484cfcc74c81..7863d09a2e6d 100644 --- a/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h +++ b/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h @@ -20,14 +20,14 @@ #pragma once #include -#include +#include // =========================================================================== // class definitions // =========================================================================== template -class GNEHierarchicalContainerChildrenHash : public std::unordered_set { +class GNEHierarchicalContainerChildrenHash : public std::set { public: /// @brief default constructor @@ -35,7 +35,7 @@ class GNEHierarchicalContainerChildrenHash : public std::unordered_set { } /// @brief parameter constructor - GNEHierarchicalContainerChildrenHash(const std::unordered_set& elements) : - std::unordered_set(elements) { + GNEHierarchicalContainerChildrenHash(const std::set& elements) : + std::set(elements) { } }; diff --git a/src/netedit/elements/GNEHierarchicalElement.h b/src/netedit/elements/GNEHierarchicalElement.h index 83cd789b0069..2f5e6660ca10 100644 --- a/src/netedit/elements/GNEHierarchicalElement.h +++ b/src/netedit/elements/GNEHierarchicalElement.h @@ -196,7 +196,7 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { /// @brief replace children in the given edited element template - void replaceChildElements(T* editedElement, const std::vector& newChildren) { + void replaceChildElements(T* editedElement, const GNEHierarchicalContainerChildren& newChildren) { // remove edited elements from children for (const auto& child : myHierarchicalStructure.getChildren()) { child->removeChildElement(editedElement); diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index 8b931305243e..761d1eb1efd7 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -437,43 +437,43 @@ GNEHierarchicalStructure::getChildren() const { template<> void -GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const GNEHierarchicalContainerChildren& newChildren) { myChildJunctions = newChildren; } template<> void -GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const GNEHierarchicalContainerChildren& newChildren) { myChildEdges = newChildren; } template<> void -GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const GNEHierarchicalContainerChildren& newChildren) { myChildLanes = newChildren; } template<> void -GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const GNEHierarchicalContainerChildren& newChildren) { myChildAdditionals = newChildren; } template<> void -GNEHierarchicalStructure::setChildrenHash(const std::unordered_set& newChildren) { +GNEHierarchicalStructure::setChildrenHash(const GNEHierarchicalContainerChildrenHash& newChildren) { myChildSourceSinks = newChildren; } template<> void -GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const GNEHierarchicalContainerChildren& newChildren) { myChildDemandElements = newChildren; } template<> void -GNEHierarchicalStructure::setChildren(const std::vector& newChildren) { +GNEHierarchicalStructure::setChildren(const GNEHierarchicalContainerChildren& newChildren) { myChildGenericDatas = newChildren; } diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index 388e2f906567..40ee3bee00c5 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -97,11 +97,11 @@ class GNEHierarchicalStructure { /// @brief set children template - void setChildren(const std::vector& newChildren); + void setChildren(const GNEHierarchicalContainerChildren& newChildren); /// @brief set children hash template - void setChildrenHash(const std::unordered_set& newChildren); + void setChildrenHash(const GNEHierarchicalContainerChildrenHash& newChildren); private: /// @brief parents junctions diff --git a/src/netedit/elements/additional/GNEAdditional.cpp b/src/netedit/elements/additional/GNEAdditional.cpp index 8f1a335156d5..fa85ca57df06 100644 --- a/src/netedit/elements/additional/GNEAdditional.cpp +++ b/src/netedit/elements/additional/GNEAdditional.cpp @@ -664,13 +664,13 @@ GNEAdditional::replaceAdditionalParentLanes(const std::string& value) { void GNEAdditional::replaceAdditionalChildEdges(const std::string& value) { - replaceChildElements(this, parse >(getNet(), value)); + replaceChildElements(this, parse >(getNet(), value)); } void GNEAdditional::replaceAdditionalChildLanes(const std::string& value) { - replaceChildElements(this, parse >(getNet(), value)); + replaceChildElements(this, parse >(getNet(), value)); } From 80c02be90fcf91d722d563227f11637f7f7dc27f Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Wed, 22 Jan 2025 16:50:12 +0100 Subject: [PATCH 073/116] Fixed crash creating TAZ with undo-redo disabled. Refs #16039 --- .../additional/GNEAdditionalHandler.cpp | 10 +++- src/netedit/frames/network/GNETAZFrame.cpp | 50 ++++++++++++++++--- src/netedit/frames/network/GNETAZFrame.h | 3 ++ 3 files changed, 54 insertions(+), 9 deletions(-) diff --git a/src/netedit/elements/additional/GNEAdditionalHandler.cpp b/src/netedit/elements/additional/GNEAdditionalHandler.cpp index 05152482b15c..7dc95b46b78d 100644 --- a/src/netedit/elements/additional/GNEAdditionalHandler.cpp +++ b/src/netedit/elements/additional/GNEAdditionalHandler.cpp @@ -1369,13 +1369,17 @@ GNEAdditionalHandler::buildTAZ(const CommonXMLStructure::SumoBaseObject* sumoBas TAZ->incRef("buildTAZ"); for (const auto& edge : edges) { // create TAZ Source - GNEAdditional* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, 1); + GNETAZSourceSink* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, 1); + myNet->getAttributeCarriers()->insertAdditional(TAZSource); TAZSource->incRef("buildTAZ"); TAZ->addChildElement(TAZSource); + edge->addChildElement(TAZSource); // create TAZ Sink - GNEAdditional* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, 1); + GNETAZSourceSink* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, 1); + myNet->getAttributeCarriers()->insertAdditional(TAZSink); TAZSink->incRef("buildTAZ"); TAZ->addChildElement(TAZSink); + edge->addChildElement(TAZSink); } } // enable updating geometry again and update geometry of TAZ @@ -1420,6 +1424,7 @@ GNEAdditionalHandler::buildTAZSource(const CommonXMLStructure::SumoBaseObject* s } else { myNet->getAttributeCarriers()->insertAdditional(TAZSource); TAZ->addChildElement(TAZSource); + edge->addChildElement(TAZSource); TAZSource->incRef("buildTAZSource"); } } else { @@ -1469,6 +1474,7 @@ GNEAdditionalHandler::buildTAZSink(const CommonXMLStructure::SumoBaseObject* sum } else { myNet->getAttributeCarriers()->insertAdditional(TAZSink); TAZ->addChildElement(TAZSink); + edge->addChildElement(TAZSink); TAZSink->incRef("buildTAZSink"); } } else { diff --git a/src/netedit/frames/network/GNETAZFrame.cpp b/src/netedit/frames/network/GNETAZFrame.cpp index fec883c1576a..22eff671f3ae 100644 --- a/src/netedit/frames/network/GNETAZFrame.cpp +++ b/src/netedit/frames/network/GNETAZFrame.cpp @@ -1650,12 +1650,25 @@ GNETAZFrame::shapeDrawed() { // TAZ is created without edges myBaseTAZ->addStringListAttribute(SUMO_ATTR_EDGES, std::vector()); } - // declare additional handler - GNEAdditionalHandler additionalHandler(myViewNet->getNet(), myViewNet->getViewParent()->getGNEAppWindows()->isUndoRedoAllowed(), false); - // build TAZ - additionalHandler.parseSumoBaseObject(myBaseTAZ); - // TAZ created, then return true - return true; + const bool allowUndoRedo = (myBaseTAZ->getStringListAttribute(SUMO_ATTR_EDGES).size() < 2000); + // due lack of memory, we need to ask if we're creating a lot of sourcesinks + if (allowUndoRedo) { + // declare additional handler + GNEAdditionalHandler additionalHandler(myViewNet->getNet(), myViewNet->getViewParent()->getGNEAppWindows()->isUndoRedoAllowed(), false); + // build TAZ + additionalHandler.parseSumoBaseObject(myBaseTAZ); + // TAZ created, then return true + return true; + } else if (askCreateMultipleSourceSinks(myBaseTAZ->getStringListAttribute(SUMO_ATTR_EDGES).size())) { + // declare additional handler + GNEAdditionalHandler additionalHandler(myViewNet->getNet(), false, false); + // build TAZ + additionalHandler.parseSumoBaseObject(myBaseTAZ); + // TAZ created, then return true + return true; + } else { + return false; + } } } @@ -1720,5 +1733,28 @@ GNETAZFrame::dropTAZMembers() { myCurrentTAZ->refreshTAZEdges(); } - +bool +GNETAZFrame::askCreateMultipleSourceSinks(const size_t numSourceSinks) const { + // declare variable to save FXMessageBox outputs. + FXuint answer = 0; + // write warning if netedit is running in testing mode + WRITE_DEBUG("Opening FXMessageBox 'Ask create multiple sourceSinks'"); + // open question dialog box + answer = FXMessageBox::question(myViewNet->getApp(), MBOX_YES_NO, TL("Create multiple sourceSInks"), + TLF("Creation of % cannot be undo. Continue?", toString(numSourceSinks)).c_str()); + if (answer != 1) { //1:yes, 2:no, 4:esc + // write warning if netedit is running in testing mode + if (answer == 2) { + WRITE_DEBUG("Closed FXMessageBox 'Ask create multiple sourceSinks' with 'No'"); + } else if (answer == 4) { + WRITE_DEBUG("Closed FXMessageBox 'Ask create multiple sourceSinks' with 'ESC'"); + } + // abort recompute with volatile options + return false; + } else { + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'Ask create multiple sourceSinks' with 'Yes'"); + return true; + } +} /****************************************************************************/ diff --git a/src/netedit/frames/network/GNETAZFrame.h b/src/netedit/frames/network/GNETAZFrame.h index 84c06169c9f1..da516777bfdc 100644 --- a/src/netedit/frames/network/GNETAZFrame.h +++ b/src/netedit/frames/network/GNETAZFrame.h @@ -568,6 +568,9 @@ class GNETAZFrame : public GNEFrame { /// @brief drop all TAZSources and TAZ Sinks of current TAZ void dropTAZMembers(); + /// @brief ask for massive TAZ creation + bool askCreateMultipleSourceSinks(const size_t numSourceSinks) const; + private: /// @brief current TAZ CurrentTAZ* myCurrentTAZ; From 01540810607a23b2e9085f07664cef3f3a5a3a7c Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Wed, 22 Jan 2025 17:18:18 +0100 Subject: [PATCH 074/116] Removed unnecessary templates. Refs #16039 --- src/netedit/elements/CMakeLists.txt | 3 -- src/netedit/elements/GNEAttributeCarrier.cpp | 12 ------ .../GNEHierarchicalContainerChildren.h | 41 ------------------- .../GNEHierarchicalContainerChildrenHash.h | 41 ------------------- .../GNEHierarchicalContainerParents.h | 41 ------------------- .../elements/GNEHierarchicalStructure.h | 16 ++++++-- 6 files changed, 13 insertions(+), 141 deletions(-) delete mode 100644 src/netedit/elements/GNEHierarchicalContainerChildren.h delete mode 100644 src/netedit/elements/GNEHierarchicalContainerChildrenHash.h delete mode 100644 src/netedit/elements/GNEHierarchicalContainerParents.h diff --git a/src/netedit/elements/CMakeLists.txt b/src/netedit/elements/CMakeLists.txt index c1975da0b3b3..0a6b35a84462 100644 --- a/src/netedit/elements/CMakeLists.txt +++ b/src/netedit/elements/CMakeLists.txt @@ -14,9 +14,6 @@ set(netedit_elements_SRCS GNEContour.h GNEGeneralHandler.cpp GNEGeneralHandler.h - GNEHierarchicalContainerParents.h - GNEHierarchicalContainerChildren.h - GNEHierarchicalContainerChildrenHash GNEHierarchicalElement.cpp GNEHierarchicalElement.h GNEHierarchicalStructure.cpp diff --git a/src/netedit/elements/GNEAttributeCarrier.cpp b/src/netedit/elements/GNEAttributeCarrier.cpp index 06843c87f57a..db02698e9075 100644 --- a/src/netedit/elements/GNEAttributeCarrier.cpp +++ b/src/netedit/elements/GNEAttributeCarrier.cpp @@ -402,12 +402,6 @@ GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { } -template<> GNEHierarchicalContainerChildren -GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { - return GNEHierarchicalContainerChildren(parse >(net, value)); -} - - template<> std::vector GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { // Declare string vector @@ -428,12 +422,6 @@ GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { } -template<> GNEHierarchicalContainerChildren -GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { - return GNEHierarchicalContainerChildren(parse >(net, value)); -} - - template<> std::string GNEAttributeCarrier::parseIDs(const std::vector& ACs) { // obtain ID's of edges and return their join diff --git a/src/netedit/elements/GNEHierarchicalContainerChildren.h b/src/netedit/elements/GNEHierarchicalContainerChildren.h deleted file mode 100644 index fe32fbda7a28..000000000000 --- a/src/netedit/elements/GNEHierarchicalContainerChildren.h +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo -// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are made available under the -// terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0/ -// This Source Code may also be made available under the following Secondary -// Licenses when the conditions for such availability set forth in the Eclipse -// Public License 2.0 are satisfied: GNU General Public License, version 2 -// or later which is available at -// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later -/****************************************************************************/ -/// @file GNEHierarchicalContainerChildren.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2025 -/// -// Template container for GNEHierarchical elements -/****************************************************************************/ -#pragma once -#include - -#include - -// =========================================================================== -// class definitions -// =========================================================================== - -template -class GNEHierarchicalContainerChildren : public std::vector { - -public: - /// @brief default constructor - GNEHierarchicalContainerChildren() { - } - - /// @brief parameter constructor - GNEHierarchicalContainerChildren(const std::vector& elements) : - std::vector(elements) { - } -}; diff --git a/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h b/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h deleted file mode 100644 index 7863d09a2e6d..000000000000 --- a/src/netedit/elements/GNEHierarchicalContainerChildrenHash.h +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo -// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are made available under the -// terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0/ -// This Source Code may also be made available under the following Secondary -// Licenses when the conditions for such availability set forth in the Eclipse -// Public License 2.0 are satisfied: GNU General Public License, version 2 -// or later which is available at -// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later -/****************************************************************************/ -/// @file GNEHierarchicalContainerChildrenHash.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2025 -/// -// Template container for GNEHierarchical elements -/****************************************************************************/ -#pragma once -#include - -#include - -// =========================================================================== -// class definitions -// =========================================================================== - -template -class GNEHierarchicalContainerChildrenHash : public std::set { - -public: - /// @brief default constructor - GNEHierarchicalContainerChildrenHash() { - } - - /// @brief parameter constructor - GNEHierarchicalContainerChildrenHash(const std::set& elements) : - std::set(elements) { - } -}; diff --git a/src/netedit/elements/GNEHierarchicalContainerParents.h b/src/netedit/elements/GNEHierarchicalContainerParents.h deleted file mode 100644 index 6ff51ac3d457..000000000000 --- a/src/netedit/elements/GNEHierarchicalContainerParents.h +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo -// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are made available under the -// terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0/ -// This Source Code may also be made available under the following Secondary -// Licenses when the conditions for such availability set forth in the Eclipse -// Public License 2.0 are satisfied: GNU General Public License, version 2 -// or later which is available at -// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later -/****************************************************************************/ -/// @file GNEHierarchicalContainerParents.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2025 -/// -// Template container for GNEHierarchical elements -/****************************************************************************/ -#pragma once -#include - -#include - -// =========================================================================== -// class definitions -// =========================================================================== - -template -class GNEHierarchicalContainerParents : public std::vector { - -public: - /// @brief default constructor - GNEHierarchicalContainerParents() { - } - - /// @brief parameter constructor - GNEHierarchicalContainerParents(const std::vector& elements) : - std::vector(elements) { - } -}; diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index 40ee3bee00c5..2b55137977ad 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -21,10 +21,20 @@ #include #include +#include -#include "GNEHierarchicalContainerParents.h" -#include "GNEHierarchicalContainerChildren.h" -#include "GNEHierarchicalContainerChildrenHash.h" +// =========================================================================== +// template declarations +// =========================================================================== + +template +using GNEHierarchicalContainerParents = std::vector; + +template +using GNEHierarchicalContainerChildren = std::vector; + +template +using GNEHierarchicalContainerChildrenHash = std::set; // =========================================================================== // class declarations From 1d68ed5c2f9aaaff9067b0422f837ab402329d7d Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Wed, 22 Jan 2025 18:42:38 +0100 Subject: [PATCH 075/116] Renamed functions. Fixed #16039 --- src/netedit/changes/GNEChange.h | 4 ++-- .../elements/GNEHierarchicalElement.cpp | 4 ++-- src/netedit/elements/GNEHierarchicalElement.h | 2 +- .../elements/GNEHierarchicalStructure.cpp | 20 +++++++++---------- .../elements/GNEHierarchicalStructure.h | 16 +++++++-------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/netedit/changes/GNEChange.h b/src/netedit/changes/GNEChange.h index 2b645e4fc162..6c0e66319504 100644 --- a/src/netedit/changes/GNEChange.h +++ b/src/netedit/changes/GNEChange.h @@ -157,7 +157,7 @@ class GNEChange : public FXObject { for (const auto& additional : myOriginalHierarchicalContainer.getChildren()) { additional->addParentElement(element); } - for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildrenHash()) { + for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildrenSet()) { TAZSourceSink->addParentElement(element); } for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren()) { @@ -206,7 +206,7 @@ class GNEChange : public FXObject { for (const auto& additional : myOriginalHierarchicalContainer.getChildren()) { additional->removeParentElement(element); } - for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildrenHash()) { + for (const auto& TAZSourceSink : myOriginalHierarchicalContainer.getChildrenSet()) { TAZSourceSink->removeParentElement(element); } for (const auto& demandElement : myOriginalHierarchicalContainer.getChildren()) { diff --git a/src/netedit/elements/GNEHierarchicalElement.cpp b/src/netedit/elements/GNEHierarchicalElement.cpp index f2df53cca63e..c6d194382e47 100644 --- a/src/netedit/elements/GNEHierarchicalElement.cpp +++ b/src/netedit/elements/GNEHierarchicalElement.cpp @@ -194,9 +194,9 @@ GNEHierarchicalElement::getChildAdditionals() const { } -const GNEHierarchicalContainerChildrenHash& +const GNEHierarchicalContainerChildrenSet& GNEHierarchicalElement::getChildTAZSourceSinks() const { - return myHierarchicalStructure.getChildrenHash(); + return myHierarchicalStructure.getChildrenSet(); } diff --git a/src/netedit/elements/GNEHierarchicalElement.h b/src/netedit/elements/GNEHierarchicalElement.h index 2f5e6660ca10..055b8ac75f9c 100644 --- a/src/netedit/elements/GNEHierarchicalElement.h +++ b/src/netedit/elements/GNEHierarchicalElement.h @@ -125,7 +125,7 @@ class GNEHierarchicalElement : public GNEAttributeCarrier { const GNEHierarchicalContainerChildren& getChildAdditionals() const; /// @brief return child TAZSourceSinks (Hash) - const GNEHierarchicalContainerChildrenHash& getChildTAZSourceSinks() const; + const GNEHierarchicalContainerChildrenSet& getChildTAZSourceSinks() const; /// @brief return child demand elements const GNEHierarchicalContainerChildren& getChildDemandElements() const; diff --git a/src/netedit/elements/GNEHierarchicalStructure.cpp b/src/netedit/elements/GNEHierarchicalStructure.cpp index 761d1eb1efd7..25563cb4cad5 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.cpp +++ b/src/netedit/elements/GNEHierarchicalStructure.cpp @@ -353,43 +353,43 @@ GNEHierarchicalStructure::getParents() const { template<> void -GNEHierarchicalStructure::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const GNEHierarchicalContainerParents& newParents) { myParentJunctions = newParents; } template<> void -GNEHierarchicalStructure::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const GNEHierarchicalContainerParents& newParents) { myParentEdges = newParents; } template<> void -GNEHierarchicalStructure::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const GNEHierarchicalContainerParents& newParents) { myParentLanes = newParents; } template<> void -GNEHierarchicalStructure::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const GNEHierarchicalContainerParents& newParents) { myParentAdditionals = newParents; } template<> void -GNEHierarchicalStructure::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const GNEHierarchicalContainerParents& newParents) { myParentTAZSourceSinks = newParents; } template<> void -GNEHierarchicalStructure::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const GNEHierarchicalContainerParents& newParents) { myParentDemandElements = newParents; } template<> void -GNEHierarchicalStructure::setParents(const std::vector& newParents) { +GNEHierarchicalStructure::setParents(const GNEHierarchicalContainerParents& newParents) { myParentGenericDatas = newParents; } @@ -418,8 +418,8 @@ GNEHierarchicalStructure::getChildren() const { } -template<> const GNEHierarchicalContainerChildrenHash& -GNEHierarchicalStructure::getChildrenHash() const { +template<> const GNEHierarchicalContainerChildrenSet& +GNEHierarchicalStructure::getChildrenSet() const { return myChildSourceSinks; } @@ -461,7 +461,7 @@ GNEHierarchicalStructure::setChildren(const GNEHierarchicalContainerChildren void -GNEHierarchicalStructure::setChildrenHash(const GNEHierarchicalContainerChildrenHash& newChildren) { +GNEHierarchicalStructure::setChildrenSet(const GNEHierarchicalContainerChildrenSet& newChildren) { myChildSourceSinks = newChildren; } diff --git a/src/netedit/elements/GNEHierarchicalStructure.h b/src/netedit/elements/GNEHierarchicalStructure.h index 2b55137977ad..b33a476d5601 100644 --- a/src/netedit/elements/GNEHierarchicalStructure.h +++ b/src/netedit/elements/GNEHierarchicalStructure.h @@ -34,7 +34,7 @@ template using GNEHierarchicalContainerChildren = std::vector; template -using GNEHierarchicalContainerChildrenHash = std::set; +using GNEHierarchicalContainerChildrenSet = std::set; // =========================================================================== // class declarations @@ -95,23 +95,23 @@ class GNEHierarchicalStructure { /// @brief set parents template - void setParents(const std::vector& newParents); + void setParents(const GNEHierarchicalContainerParents& newParents); /// @brief get children template const GNEHierarchicalContainerChildren& getChildren() const; - /// @brief get children hash + /// @brief get children set template - const GNEHierarchicalContainerChildrenHash& getChildrenHash() const; + const GNEHierarchicalContainerChildrenSet& getChildrenSet() const; /// @brief set children template void setChildren(const GNEHierarchicalContainerChildren& newChildren); - /// @brief set children hash + /// @brief set children set template - void setChildrenHash(const GNEHierarchicalContainerChildrenHash& newChildren); + void setChildrenSet(const GNEHierarchicalContainerChildrenSet& newChildren); private: /// @brief parents junctions @@ -147,8 +147,8 @@ class GNEHierarchicalStructure { /// @brief children additional elements GNEHierarchicalContainerChildren myChildAdditionals; - /// @brief children TAZSourceSinks elements (hash) - GNEHierarchicalContainerChildrenHash myChildSourceSinks; + /// @brief children TAZSourceSinks elements (set) + GNEHierarchicalContainerChildrenSet myChildSourceSinks; /// @brief children demand elements GNEHierarchicalContainerChildren myChildDemandElements; From d47ca084b4bf9ebe66f11412451f09a111c0b495 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 08:51:43 +0100 Subject: [PATCH 076/116] adapting test suites for gdal and non-gdal tests. refs #21 --- tests/polyconvert/import/testsuite.polyconvert | 3 --- tests/polyconvert/import/testsuite.polyconvert.gdal | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/polyconvert/import/testsuite.polyconvert b/tests/polyconvert/import/testsuite.polyconvert index cd96b4f70cde..c409880f76de 100644 --- a/tests/polyconvert/import/testsuite.polyconvert +++ b/tests/polyconvert/import/testsuite.polyconvert @@ -6,6 +6,3 @@ dlr_navteq # importing our own XML format XML - -# test import of geojson files -geojson diff --git a/tests/polyconvert/import/testsuite.polyconvert.gdal b/tests/polyconvert/import/testsuite.polyconvert.gdal index 18b6e64f8862..9aff80307378 100644 --- a/tests/polyconvert/import/testsuite.polyconvert.gdal +++ b/tests/polyconvert/import/testsuite.polyconvert.gdal @@ -1,2 +1,5 @@ # importing ESRI shapes shape + +# test import of geojson files +geojson From f37231df5c8b9ec2e71d7da4541da52180b86489 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 09:17:38 +0100 Subject: [PATCH 077/116] added tests refs #21, #16055 --- .../null_attributes/errors.polyconvert | 0 .../geojson/null_attributes/input.geojson | 9 +++ .../null_attributes/options.polyconvert | 2 + .../null_attributes/output.polyconvert | 5 ++ .../geojson/null_attributes/pois.polyconvert | 64 +++++++++++++++++++ .../import/geojson/testsuite.polyconvert | 3 + 6 files changed, 83 insertions(+) create mode 100644 tests/polyconvert/import/geojson/null_attributes/errors.polyconvert create mode 100644 tests/polyconvert/import/geojson/null_attributes/input.geojson create mode 100644 tests/polyconvert/import/geojson/null_attributes/options.polyconvert create mode 100644 tests/polyconvert/import/geojson/null_attributes/output.polyconvert create mode 100644 tests/polyconvert/import/geojson/null_attributes/pois.polyconvert diff --git a/tests/polyconvert/import/geojson/null_attributes/errors.polyconvert b/tests/polyconvert/import/geojson/null_attributes/errors.polyconvert new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/polyconvert/import/geojson/null_attributes/input.geojson b/tests/polyconvert/import/geojson/null_attributes/input.geojson new file mode 100644 index 000000000000..7d1ed9a5819b --- /dev/null +++ b/tests/polyconvert/import/geojson/null_attributes/input.geojson @@ -0,0 +1,9 @@ +{ +"type": "FeatureCollection", +"name": "241113_VerkehrsmengenLE", +"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::25833" } }, +"features": [ +{ "type": "Feature", "properties": { "objectid": 234545.0, "Sid": 1.0, "GN_Kfz_Rund": 2500.0, "GN_Kfz_Jahr": 1991.0, "GN_SV_Rund": 400.0, "GN_Rad_Rund": 0.0, "GN_Rad_Jahr": 1991.0, "N_CODE_23": null }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ 318686.761500000022352, 5694908.745899999514222 ], [ 318741.306300000287592, 5694640.399399999529123 ], [ 318744.75650000013411, 5694628.373299999162555 ] ] ] } }, +{ "type": "Feature", "properties": { "objectid": 235542.0, "Sid": 1001.0, "GN_Kfz_Rund": null, "GN_Kfz_Jahr": null, "GN_SV_Rund": null, "GN_Rad_Rund": null, "GN_Rad_Jahr": null, "N_CODE_23": null }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ 318765.183899999596179, 5691598.371799999848008 ], [ 318855.291000000201166, 5691587.5142 ] ] ] } } +] +} diff --git a/tests/polyconvert/import/geojson/null_attributes/options.polyconvert b/tests/polyconvert/import/geojson/null_attributes/options.polyconvert new file mode 100644 index 000000000000..f4aaa77440e5 --- /dev/null +++ b/tests/polyconvert/import/geojson/null_attributes/options.polyconvert @@ -0,0 +1,2 @@ +-v --geojson-files input.geojson -o pois.poi.xml --all-attributes + diff --git a/tests/polyconvert/import/geojson/null_attributes/output.polyconvert b/tests/polyconvert/import/geojson/null_attributes/output.polyconvert new file mode 100644 index 000000000000..45f41eed9568 --- /dev/null +++ b/tests/polyconvert/import/geojson/null_attributes/output.polyconvert @@ -0,0 +1,5 @@ +Parsing from geojson-file 'input.geojson' ... +Available fields: objectid Sid GN_Kfz_Rund GN_Kfz_Jahr GN_SV_Rund GN_Rad_Rund GN_Rad_Jahr N_CODE_23 + done. + done. +Success. diff --git a/tests/polyconvert/import/geojson/null_attributes/pois.polyconvert b/tests/polyconvert/import/geojson/null_attributes/pois.polyconvert new file mode 100644 index 000000000000..868439b9d5b7 --- /dev/null +++ b/tests/polyconvert/import/geojson/null_attributes/pois.polyconvert @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/polyconvert/import/geojson/testsuite.polyconvert b/tests/polyconvert/import/geojson/testsuite.polyconvert index f7f1e5994204..883df5dc5566 100644 --- a/tests/polyconvert/import/geojson/testsuite.polyconvert +++ b/tests/polyconvert/import/geojson/testsuite.polyconvert @@ -3,3 +3,6 @@ no_crs # import all attributes all-attributes + +# import all attributes but some have null values +null_attributes From 1e9ceb7ce15b225471e9c1e5bb3d5a63c2906880 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 09:18:19 +0100 Subject: [PATCH 078/116] avoid writing null values as 0. refs #16055 --- src/polyconvert/PCLoaderArcView.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/polyconvert/PCLoaderArcView.cpp b/src/polyconvert/PCLoaderArcView.cpp index 2c3ce837d01a..50d149285c58 100644 --- a/src/polyconvert/PCLoaderArcView.cpp +++ b/src/polyconvert/PCLoaderArcView.cpp @@ -316,11 +316,7 @@ PCLoaderArcView::load(const std::string& file, OptionsCont& oc, PCPolyContainer& for (int iField = 0; iField < poFDefn->GetFieldCount(); iField++) { OGRFieldDefn* poFieldDefn = poFDefn->GetFieldDefn(iField); if (poFieldDefn->GetNameRef() != idField) { - if (poFieldDefn->GetType() == OFTReal) { - (*it)->setParameter(poFieldDefn->GetNameRef(), toString(poFeature->GetFieldAsDouble(iField))); - } else { - (*it)->setParameter(poFieldDefn->GetNameRef(), StringUtils::latin1_to_utf8(poFeature->GetFieldAsString(iField))); - } + (*it)->setParameter(poFieldDefn->GetNameRef(), StringUtils::latin1_to_utf8(poFeature->GetFieldAsString(iField))); } } } From 6d86ccd104b72d2f2f017ee0331dac5342ffeceb Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 09:18:28 +0100 Subject: [PATCH 079/116] patching expected results refs #21, #16055 --- .../geojson/null_attributes/pois.polyconvert | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/polyconvert/import/geojson/null_attributes/pois.polyconvert b/tests/polyconvert/import/geojson/null_attributes/pois.polyconvert index 868439b9d5b7..5e9838515fce 100644 --- a/tests/polyconvert/import/geojson/null_attributes/pois.polyconvert +++ b/tests/polyconvert/import/geojson/null_attributes/pois.polyconvert @@ -1,6 +1,6 @@ -' % bestEdge.getID() + foutobj.write(' %s\n' % (bestReverse.getID(), attrs, comment)) + comment = ' ' % bestReverse.getID() + usedEdges.add(bestEdge) + foutobj.write(' %s\n' % (bestEdge.getID(), attrs, comment)) + foutobj.write(' \n') + foutobj.write('\n') + + +if __name__ == "__main__": + main(get_options()) From 9e4fa64785967fbfb6dcdf937616c46be882f00e Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 10:34:10 +0100 Subject: [PATCH 081/116] #2 added link --- docs/web/docs/Demand/Routes_from_Observation_Points.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/web/docs/Demand/Routes_from_Observation_Points.md b/docs/web/docs/Demand/Routes_from_Observation_Points.md index 53c8be0ae92f..931d946fd0d9 100644 --- a/docs/web/docs/Demand/Routes_from_Observation_Points.md +++ b/docs/web/docs/Demand/Routes_from_Observation_Points.md @@ -14,6 +14,8 @@ The generated traffic should obviously match the counting data but this requirem - [jtcrouter](../Tools/Turns.md#jtcrouterpy) uses turn-counts - [routeSampler](../Tools/Turns.md#routesamplerpy) uses turn-counts and edge counts (and also origin-destination counts) +There is also a large suite of tools to import and transform different counting data formats. An overview of these can be found at [Counting data meta ticket](https://github.com/eclipse-sumo/sumo/issues/6609). + ## Choosing the right tool The algorithms listed above where developed to solve different problems and may work badly when used on the wrong kind of problem. From ba5cd9eec9ba894a94b58d1f2f5804636b7a704b Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 10:37:29 +0100 Subject: [PATCH 082/116] #2 note on creating geojson with edge data --- docs/web/docs/Tools/Net.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/web/docs/Tools/Net.md b/docs/web/docs/Tools/Net.md index 7c5956196fc7..1f25a2a8a908 100644 --- a/docs/web/docs/Tools/Net.md +++ b/docs/web/docs/Tools/Net.md @@ -194,6 +194,7 @@ By default, normal edge geometries will be exported. This can be changed with op - **--lanes**: write lane geometries - **--internal**: write junction-internal edges or lanes +It is also possible to enrich the generated geojson with edge-related data (i.e. traffic counts or speeds) by loading an edgedata file with option **--edgedata-file**. # split_at_stops.py From f0b62dd6754b2fed8ecd1d5601b60d03d76db96e Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 11:06:25 +0100 Subject: [PATCH 083/116] added tests refs #21, #16051 --- tests/tools/config.tools | 1 + .../shapes/poly2edgedata/basic/edgedata.tools | 9 ++ .../shapes/poly2edgedata/basic/errors.tools | 3 + .../shapes/poly2edgedata/basic/options.tools | 1 + .../shapes/poly2edgedata/basic/output.tools | 0 .../poly2edgedata/filter/edgedata.tools | 7 ++ .../shapes/poly2edgedata/filter/errors.tools | 2 + .../shapes/poly2edgedata/filter/options.tools | 1 + .../shapes/poly2edgedata/filter/output.tools | 0 .../tools/shapes/poly2edgedata/input.poly.xml | 27 +++++ tests/tools/shapes/poly2edgedata/net.net.xml | 110 ++++++++++++++++++ .../poly2edgedata/noSplit/edgedata.tools | 9 ++ .../shapes/poly2edgedata/noSplit/errors.tools | 3 + .../poly2edgedata/noSplit/options.tools | 1 + .../shapes/poly2edgedata/noSplit/output.tools | 0 .../tools/shapes/poly2edgedata/options.tools | 1 + .../tools/shapes/poly2edgedata/patch/data.txt | 8 ++ .../shapes/poly2edgedata/patch/edgedata.tools | 10 ++ .../shapes/poly2edgedata/patch/errors.tools | 2 + .../shapes/poly2edgedata/patch/options.tools | 1 + .../shapes/poly2edgedata/patch/output.tools | 1 + .../shapes/poly2edgedata/split/edgedata.tools | 9 ++ .../shapes/poly2edgedata/split/errors.tools | 3 + .../shapes/poly2edgedata/split/options.tools | 1 + .../shapes/poly2edgedata/split/output.tools | 0 .../shapes/poly2edgedata/testsuite.tools | 13 +++ tests/tools/shapes/testsuite.tools | 3 + 27 files changed, 226 insertions(+) create mode 100644 tests/tools/shapes/poly2edgedata/basic/edgedata.tools create mode 100644 tests/tools/shapes/poly2edgedata/basic/errors.tools create mode 100644 tests/tools/shapes/poly2edgedata/basic/options.tools create mode 100644 tests/tools/shapes/poly2edgedata/basic/output.tools create mode 100644 tests/tools/shapes/poly2edgedata/filter/edgedata.tools create mode 100644 tests/tools/shapes/poly2edgedata/filter/errors.tools create mode 100644 tests/tools/shapes/poly2edgedata/filter/options.tools create mode 100644 tests/tools/shapes/poly2edgedata/filter/output.tools create mode 100644 tests/tools/shapes/poly2edgedata/input.poly.xml create mode 100644 tests/tools/shapes/poly2edgedata/net.net.xml create mode 100644 tests/tools/shapes/poly2edgedata/noSplit/edgedata.tools create mode 100644 tests/tools/shapes/poly2edgedata/noSplit/errors.tools create mode 100644 tests/tools/shapes/poly2edgedata/noSplit/options.tools create mode 100644 tests/tools/shapes/poly2edgedata/noSplit/output.tools create mode 100644 tests/tools/shapes/poly2edgedata/options.tools create mode 100644 tests/tools/shapes/poly2edgedata/patch/data.txt create mode 100644 tests/tools/shapes/poly2edgedata/patch/edgedata.tools create mode 100644 tests/tools/shapes/poly2edgedata/patch/errors.tools create mode 100644 tests/tools/shapes/poly2edgedata/patch/options.tools create mode 100644 tests/tools/shapes/poly2edgedata/patch/output.tools create mode 100644 tests/tools/shapes/poly2edgedata/split/edgedata.tools create mode 100644 tests/tools/shapes/poly2edgedata/split/errors.tools create mode 100644 tests/tools/shapes/poly2edgedata/split/options.tools create mode 100644 tests/tools/shapes/poly2edgedata/split/output.tools create mode 100644 tests/tools/shapes/poly2edgedata/testsuite.tools diff --git a/tests/tools/config.tools b/tests/tools/config.tools index 2cf0272aced4..cd4549c3bea2 100644 --- a/tests/tools/config.tools +++ b/tests/tools/config.tools @@ -6,6 +6,7 @@ copy_test_path:routes2.rou.xml copy_test_path:net.net.xml copy_test_path:net2.net.xml copy_test_path:net3.net.xml +copy_test_path:input.poly.xml copy_test_path:input_additional.add.xml copy_test_path:input_additional2.add.xml copy_test_path:three_split.net.xml diff --git a/tests/tools/shapes/poly2edgedata/basic/edgedata.tools b/tests/tools/shapes/poly2edgedata/basic/edgedata.tools new file mode 100644 index 000000000000..1a8b11e638a8 --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/basic/edgedata.tools @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/tools/shapes/poly2edgedata/basic/errors.tools b/tests/tools/shapes/poly2edgedata/basic/errors.tools new file mode 100644 index 000000000000..1b4e4af9ae6c --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/basic/errors.tools @@ -0,0 +1,3 @@ +No long edges near 472.67,-21.29 (poly po_0) +Duplicate assignment to edge -E0 from poly po_2 +No edges with angle -71.50 found near -55.50,157.53 (poly po_4) diff --git a/tests/tools/shapes/poly2edgedata/basic/options.tools b/tests/tools/shapes/poly2edgedata/basic/options.tools new file mode 100644 index 000000000000..f7b2db4bb52f --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/basic/options.tools @@ -0,0 +1 @@ +input.poly.xml -n net.net.xml -o edgedata.xml diff --git a/tests/tools/shapes/poly2edgedata/basic/output.tools b/tests/tools/shapes/poly2edgedata/basic/output.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/shapes/poly2edgedata/filter/edgedata.tools b/tests/tools/shapes/poly2edgedata/filter/edgedata.tools new file mode 100644 index 000000000000..2ed223c7f8dd --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/filter/edgedata.tools @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/tools/shapes/poly2edgedata/filter/errors.tools b/tests/tools/shapes/poly2edgedata/filter/errors.tools new file mode 100644 index 000000000000..484fb5d7f5af --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/filter/errors.tools @@ -0,0 +1,2 @@ +No long edges near 472.67,-21.29 (poly po_0) +No edges with angle -71.50 found near -55.50,157.53 (poly po_4) diff --git a/tests/tools/shapes/poly2edgedata/filter/options.tools b/tests/tools/shapes/poly2edgedata/filter/options.tools new file mode 100644 index 000000000000..8d422b441d2d --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/filter/options.tools @@ -0,0 +1 @@ +input.poly.xml -n net.net.xml -o edgedata.xml --filter foo,45,100 diff --git a/tests/tools/shapes/poly2edgedata/filter/output.tools b/tests/tools/shapes/poly2edgedata/filter/output.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/shapes/poly2edgedata/input.poly.xml b/tests/tools/shapes/poly2edgedata/input.poly.xml new file mode 100644 index 000000000000..a36526dcd061 --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/input.poly.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tools/shapes/poly2edgedata/net.net.xml b/tests/tools/shapes/poly2edgedata/net.net.xml new file mode 100644 index 000000000000..c21808c50e9d --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/net.net.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tools/shapes/poly2edgedata/noSplit/edgedata.tools b/tests/tools/shapes/poly2edgedata/noSplit/edgedata.tools new file mode 100644 index 000000000000..4e3a04d68625 --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/noSplit/edgedata.tools @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/tools/shapes/poly2edgedata/noSplit/errors.tools b/tests/tools/shapes/poly2edgedata/noSplit/errors.tools new file mode 100644 index 000000000000..1b4e4af9ae6c --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/noSplit/errors.tools @@ -0,0 +1,3 @@ +No long edges near 472.67,-21.29 (poly po_0) +Duplicate assignment to edge -E0 from poly po_2 +No edges with angle -71.50 found near -55.50,157.53 (poly po_4) diff --git a/tests/tools/shapes/poly2edgedata/noSplit/options.tools b/tests/tools/shapes/poly2edgedata/noSplit/options.tools new file mode 100644 index 000000000000..78172d13ffb8 --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/noSplit/options.tools @@ -0,0 +1 @@ +input.poly.xml -n net.net.xml -o edgedata.xml --nosplit-attributes bar diff --git a/tests/tools/shapes/poly2edgedata/noSplit/output.tools b/tests/tools/shapes/poly2edgedata/noSplit/output.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/shapes/poly2edgedata/options.tools b/tests/tools/shapes/poly2edgedata/options.tools new file mode 100644 index 000000000000..1a9be4d34122 --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/options.tools @@ -0,0 +1 @@ +tools/shapes/poly2edgedata.py diff --git a/tests/tools/shapes/poly2edgedata/patch/data.txt b/tests/tools/shapes/poly2edgedata/patch/data.txt new file mode 100644 index 000000000000..d802f6330bfb --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/patch/data.txt @@ -0,0 +1,8 @@ +# comment +rev -E0 E3 +rev E0 None +edg po_4 E6 +edg E8 None +dat po_3 foo 100 +dat po_1 bar None +dummy diff --git a/tests/tools/shapes/poly2edgedata/patch/edgedata.tools b/tests/tools/shapes/poly2edgedata/patch/edgedata.tools new file mode 100644 index 000000000000..87de150dbf05 --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/patch/edgedata.tools @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tests/tools/shapes/poly2edgedata/patch/errors.tools b/tests/tools/shapes/poly2edgedata/patch/errors.tools new file mode 100644 index 000000000000..484fb5d7f5af --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/patch/errors.tools @@ -0,0 +1,2 @@ +No long edges near 472.67,-21.29 (poly po_0) +No edges with angle -71.50 found near -55.50,157.53 (poly po_4) diff --git a/tests/tools/shapes/poly2edgedata/patch/options.tools b/tests/tools/shapes/poly2edgedata/patch/options.tools new file mode 100644 index 000000000000..058647f5a489 --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/patch/options.tools @@ -0,0 +1 @@ +input.poly.xml -n net.net.xml -o edgedata.xml --patchfile data.txt diff --git a/tests/tools/shapes/poly2edgedata/patch/output.tools b/tests/tools/shapes/poly2edgedata/patch/output.tools new file mode 100644 index 000000000000..09f35bcfc374 --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/patch/output.tools @@ -0,0 +1 @@ +unknown patchtype 'dummy' diff --git a/tests/tools/shapes/poly2edgedata/split/edgedata.tools b/tests/tools/shapes/poly2edgedata/split/edgedata.tools new file mode 100644 index 000000000000..4e3a04d68625 --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/split/edgedata.tools @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/tools/shapes/poly2edgedata/split/errors.tools b/tests/tools/shapes/poly2edgedata/split/errors.tools new file mode 100644 index 000000000000..1b4e4af9ae6c --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/split/errors.tools @@ -0,0 +1,3 @@ +No long edges near 472.67,-21.29 (poly po_0) +Duplicate assignment to edge -E0 from poly po_2 +No edges with angle -71.50 found near -55.50,157.53 (poly po_4) diff --git a/tests/tools/shapes/poly2edgedata/split/options.tools b/tests/tools/shapes/poly2edgedata/split/options.tools new file mode 100644 index 000000000000..007e227af9ab --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/split/options.tools @@ -0,0 +1 @@ +input.poly.xml -n net.net.xml -o edgedata.xml --split-attributes foo diff --git a/tests/tools/shapes/poly2edgedata/split/output.tools b/tests/tools/shapes/poly2edgedata/split/output.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/shapes/poly2edgedata/testsuite.tools b/tests/tools/shapes/poly2edgedata/testsuite.tools new file mode 100644 index 000000000000..7962cf1575d8 --- /dev/null +++ b/tests/tools/shapes/poly2edgedata/testsuite.tools @@ -0,0 +1,13 @@ +basic + +# split values between edge and reverse edge +split + +# split values between edge and reverse edge +noSplit + +# filter by attribute value +filter + +# load patch file +patch diff --git a/tests/tools/shapes/testsuite.tools b/tests/tools/shapes/testsuite.tools index 468205e764f7..5b2cd400b8f1 100644 --- a/tests/tools/shapes/testsuite.tools +++ b/tests/tools/shapes/testsuite.tools @@ -12,3 +12,6 @@ poi_at_stops # Tests for Point of Interest at Trafic light signals poi_atTLS + +# map polygons onto network edges +poly2edgedata From 030203e2b9cf94b368650ba0f14ec369741e7056 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 11:06:44 +0100 Subject: [PATCH 084/116] small refinements refs #16051 --- tools/shapes/poly2edgedata.py | 87 ++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/tools/shapes/poly2edgedata.py b/tools/shapes/poly2edgedata.py index c223bb8dab1b..c241a0b2416e 100755 --- a/tools/shapes/poly2edgedata.py +++ b/tools/shapes/poly2edgedata.py @@ -20,7 +20,7 @@ For each polygon a unique edge is selected that gives the best geometrical match The following syntax is supported in the patch file (one patch per line): - + # lines starting with '#' are ignored as comments # rev overrides the reverse edge of EDGEID to be REVEDGEID rev EDGEID REVEDGEID @@ -69,7 +69,7 @@ def get_options(args=None): help="If a reverse edge is found, split the values of the given attribute list among edge and reverse edge") op.add_option("-S", "--nosplit-attributes", dest="noSplitAttrs", help="If a reverse edge is found, split the values of all attributes except the given attribute list among edge and reverse edge") # noqa - op.add_option("-f", "--filter", dest="filter", + op.add_option("-f", "--filter", dest="filter", help="Read a list of triplets ATTR,MIN,MAX and only keep polygons where value ATTR is within [MIN,MAX]") op.add_option("-b", "--begin", default=0, type=op.time, help="edgedata interval begin time") @@ -104,25 +104,27 @@ def readPatches(net, pfile): patchEdg = {} # polyID->edge patchRev = {} # forwardEdge->reverseEdge patchDat = defaultdict(lambda: {}) # polyID->attr->data (-1 ignores) - with open(pfile) as pf: - for line in pf: - items = line.split() - patchtype = items[0] - if patchtype == "rev": - edgeID, reverseID = items[1:] - patchRev[edgeID] = reverseID - test = net.getEdge(edgeID) - elif patchtype == "edg": - polyID, edgeID = items[1:] - patchEdg[polyID] = edgeID - elif patchtype == "dat": - polyID, attrName, value = items[1:] - patchDat[polyID][attrName] = value - elif patchtype == "#": - # comment - continue - else: - print("unknown patchtype '%s'" % patchtype) + if pfile is not None: + with open(pfile) as pf: + for line in pf: + items = line.split() + patchtype = items[0] + if patchtype == "rev": + edgeID, reverseID = items[1:] + patchRev[edgeID] = reverseID + test = net.getEdge(edgeID) + elif patchtype == "edg": + polyID, edgeID = items[1:] + patchEdg[polyID] = edgeID + elif patchtype == "dat": + polyID, attrName, value = items[1:] + patchDat[polyID][attrName] = value + elif patchtype == "#": + # comment + continue + else: + print("unknown patchtype '%s'" % patchtype) + return patchEdg, patchRev, patchDat @@ -157,7 +159,7 @@ def main(options): if not edges: print("No long edges near %.2f,%.2f (poly %s)" % (cx, cy, poly.id), file=sys.stderr) continue - + if shapelen < scut: polyAngle = gh.angleTo2D(shape[0], shape[-1]) else: @@ -242,28 +244,29 @@ def main(options): print("Duplicate assignment to reverse edge %s from poly %s%s" % ( bestReverse.getID(), poly.id, patchInfo), file=sys.stderr) continue - + attrs = 'polyID="%s"' % poly.id skip = False - for param in poly.param: - value = param.value - if poly.id in patchDat: - if param.key in patchDat[poly.id]: - value = patchDat[poly.id][param.key] - #print("patched %s to %s" % (param.value, value)) - if value == PATCH_NONE: - continue - if param.key in options.filter: - if (float(value) < options.filter[param.key][0] or - float(value) > options.filter[param.key][1]): - skip = True - if bestReverse is not None and (param.key in options.splitAttrs - or options.noSplitAttrs and param.key not in options.noSplitAttrs): - try: - value = float(value) / 2 - except: - pass - attrs += ' %s="%s"' % (param.key, value) + if poly.param: + for param in poly.param: + value = param.value + if poly.id in patchDat: + if param.key in patchDat[poly.id]: + value = patchDat[poly.id][param.key] + #print("patched %s to %s" % (param.value, value)) + if value == PATCH_NONE: + continue + if param.key in options.filter: + if (float(value) < options.filter[param.key][0] or + float(value) > options.filter[param.key][1]): + skip = True + if bestReverse is not None and (param.key in options.splitAttrs + or options.noSplitAttrs and param.key not in options.noSplitAttrs): + try: + value = float(value) / 2 + except: + pass + attrs += ' %s="%s"' % (param.key, value) if skip: continue From 495d275be6d614c99ea68739b43238f209cd5c78 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 11:14:59 +0100 Subject: [PATCH 085/116] #2 doc #16051 --- docs/web/docs/Tools/Shapes.md | 46 ++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/docs/web/docs/Tools/Shapes.md b/docs/web/docs/Tools/Shapes.md index 4cc950daf373..232e9802eb23 100644 --- a/docs/web/docs/Tools/Shapes.md +++ b/docs/web/docs/Tools/Shapes.md @@ -33,7 +33,7 @@ induction loop detectors. Each PoI is replicated to cover all lanes of the road. The detectors are named "__l". ``` -pois2inductionLoops.py +/tools/shape/pois2inductionLoops.py ``` - : The net to use for retrieving lane numbers @@ -53,7 +53,7 @@ chains of connected edges are not allowed -\> this needs two different runs of this script. Output is written in file 'pois.add.xml' ``` -poi_alongRoads.py [,]* +/tools/shape/poi_alongRoads.py [,]* ``` - : The net to use for retrieving the geometry @@ -73,7 +73,7 @@ Spatial distribute of POIs along given edges on a given network. Generates a PoI-file containing a PoI for each Stop from the given net. ``` -poi_at_stops.py +/tools/shape/poi_at_stops.py ``` - : The network @@ -91,7 +91,7 @@ Generates a PoI-file containing a PoI for each tls controlled intersection from the given net. ``` -poi_atTLS.py [nojoin] +/tools/shape/poi_atTLS.py [nojoin] ``` - : The net to read traffic light (tls) positions from @@ -104,3 +104,41 @@ poi_atTLS.py [nojoin] PoIs are stored with type="default", color="1,0,0", and layer="0". The tool uses the /tools/lib/sumonet.py library. + +# poly2edgedata.py + +Transform polygons with params into edgedata with attributes +For each polygon a unique edge is selected that gives the best geometrical match. + +``` +/tools/shape/poly2edgedata.py -n NETFILE -o OUTPUT_EDGEDATA +``` + +Further options: + +- **--split-attributes** and **--nosplit-attributes** support the use case where a single polygon applies to both directions of a road and related data must be split for the forward and reverse edge (i.e. traffic counts). +- **--filter ATTR,MIN,MAX** supports filtering out polygons where ATTR is not in range [MIN,MAX] +- **--radius**: maximum matching radius (default 20) +- **--min-length**: avoid matching to short edges (default 10) +- **--angle-tolerance**: avoid matching if edge and shape angle are too different (default 20 degrees) + +!!! note + polygons can be obtained from OSM, shapefiles or geojson with the help of [../ + +## patches +Option **--patchfile** loads instructions to modify the matching in special cases. +The following syntax is supported in the patch file (one patch per line): + +# lines starting with '#' are ignored as comments +# rev overrides the reverse edge of EDGEID to be REVEDGEID +rev EDGEID REVEDGEID +# edg overrides the edge to assign for POLYID to be EDGEID +edg POLYID EDGEID +# dat overrrides the data attribute ATTR for POLYID to take on value VALUE +dat POLYID ATTR VALUE + +any ID or VALUE may bet set to 'None' to signify that +- a reverse edge should not be assigned +- a polygon should not be mapped +- data should be ignored +polyconvert.md] From c8fc659b337f01c912a23ae54e474a76a84414df Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 11:18:46 +0100 Subject: [PATCH 086/116] #2 formatting --- docs/web/docs/Tools/Shapes.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/web/docs/Tools/Shapes.md b/docs/web/docs/Tools/Shapes.md index 232e9802eb23..c9d4e0d07135 100644 --- a/docs/web/docs/Tools/Shapes.md +++ b/docs/web/docs/Tools/Shapes.md @@ -107,7 +107,7 @@ The tool uses the /tools/lib/sumonet.py library. # poly2edgedata.py -Transform polygons with params into edgedata with attributes +Transform polygons with params into edgedata with attributes. For each polygon a unique edge is selected that gives the best geometrical match. ``` @@ -123,12 +123,13 @@ Further options: - **--angle-tolerance**: avoid matching if edge and shape angle are too different (default 20 degrees) !!! note - polygons can be obtained from OSM, shapefiles or geojson with the help of [../ + polygons can be obtained from OSM, shapefiles or geojson with the help of [../polyconvert.md] ## patches Option **--patchfile** loads instructions to modify the matching in special cases. The following syntax is supported in the patch file (one patch per line): +``` # lines starting with '#' are ignored as comments # rev overrides the reverse edge of EDGEID to be REVEDGEID rev EDGEID REVEDGEID @@ -136,9 +137,10 @@ rev EDGEID REVEDGEID edg POLYID EDGEID # dat overrrides the data attribute ATTR for POLYID to take on value VALUE dat POLYID ATTR VALUE +``` any ID or VALUE may bet set to 'None' to signify that - a reverse edge should not be assigned - a polygon should not be mapped - data should be ignored -polyconvert.md] + From 038fc6df20bbac2ee6e0a258cb23a2fbe127215b Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 11:19:28 +0100 Subject: [PATCH 087/116] #2 formatting --- docs/web/docs/Tools/Shapes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/web/docs/Tools/Shapes.md b/docs/web/docs/Tools/Shapes.md index c9d4e0d07135..6dc49830167a 100644 --- a/docs/web/docs/Tools/Shapes.md +++ b/docs/web/docs/Tools/Shapes.md @@ -140,6 +140,7 @@ dat POLYID ATTR VALUE ``` any ID or VALUE may bet set to 'None' to signify that + - a reverse edge should not be assigned - a polygon should not be mapped - data should be ignored From 1a53d26fe734f7237f34902dc3d946018e5014eb Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 11:25:54 +0100 Subject: [PATCH 088/116] #2 doc #16041 --- docs/web/docs/Tools/Routes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/web/docs/Tools/Routes.md b/docs/web/docs/Tools/Routes.md index 804d12a1a255..a6ae16687b73 100644 --- a/docs/web/docs/Tools/Routes.md +++ b/docs/web/docs/Tools/Routes.md @@ -257,6 +257,7 @@ python tools/countEdgeUsage.py --output-file --subpar This will only generate results for routes that contain the edge sequence *edge3 edge4 edge5*. +By default, subpart must be a sequence of consecutive edges. By adding option **--subpart.via**, non-consecutive sequences are permitted. # addParkingAreaStops2Routes.py From e93020fe892ac9348466bdc9fecdf34c54a6c164 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 11:32:39 +0100 Subject: [PATCH 089/116] #2 changelog --- docs/web/docs/ChangeLog.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/web/docs/ChangeLog.md b/docs/web/docs/ChangeLog.md index 799732ecef1c..5505665c7f4d 100644 --- a/docs/web/docs/ChangeLog.md +++ b/docs/web/docs/ChangeLog.md @@ -58,6 +58,7 @@ title: ChangeLog - E2 multilane detectors can be moved avain #15551 (regression in 1.20.0) - Fixed invalid rectangle selection when zoomed out #15766 (regression in 1.20.0) - Traffic light mode shows traffic light icons again when zoomed out #15966 (regression in 1.20.0) + - Fixed crash when loading nework with crossings and overlapping edge geometry #16053 (regression in 1.21.0) - Loaded containers starting from stops are now drawn #15567 - ESC aborts creation of edgeRel and tazRel datas #15601 - Fixed invalid TAZ coloring during mouse hovering in create TAZRel mode #15544 @@ -103,7 +104,9 @@ title: ChangeLog - Fixed Invalid behavior after loading demand elements with keep old enabled #15904 - Dotted contour no longer hides flow label and vehicle stack label #15929 - Fixed crash editing vClass in VType dialog #16008 - - Selection mode function 'select parents' now selects incoming and outgoing lane of selected connections #15968 + - Selection mode function 'select parents' now selects incoming and outgoing lane of selected connections #15968 + - Fixed invalid weights loading values of TAZ source/sinks #16037 + - Fixed "freezing" when handling very large TAZ #15844 - sumo-gui - Fixed framerate drop when zoomed in very far #15666 @@ -136,6 +139,7 @@ title: ChangeLog - Fixed invalid route involving vClass-restricted connection #15883 - meso + - fixed invalid queue assignment for turning vehicles #16034 (regression in 1.7.0) - Fixed crash when using **--mapmatch.junctions** in a network with internal edges #15741 - Fixed crash when using **--time-to-teleport.disconnected** #15751 - Option **--time-to-teleport.disconnected** is now working when connections are missing #15777 @@ -222,7 +226,8 @@ title: ChangeLog - The lane parameter dialog provide information on driveway/foes that prevent train insertion #15823 - A selection file loaded with **--selection-file** will now cause vehicles, persons and containers to be selected as soon as they are loaded #5427, #14093 - Improved layering of chargingStation and parkingArea #15826 - - Disabled 'secondary shape' controls if no alternative net is loaded #12653 + - Disabled 'secondary shape' controls if no alternative net is loaded #12653 + - edge color legend now shows the used attribute/key #16026 - netconvert - Added support for zipped shape files #15623 @@ -238,7 +243,10 @@ title: ChangeLog - duarouter - The input file for ALT-landmarks can now be defined with geo-coordinates #15855 - - Option **--scale** can now be used for scaling traffic #8353 + - Option **--scale** can now be used for scaling traffic #8353 + +- polyconvert + - Added option **--geosjon-files** for official geojson support #16055 - TraCI - stationfinder device parameters can now be modified at runtime #15622 @@ -274,7 +282,12 @@ title: ChangeLog - xml2csv.py: Added option **--keep-attributes** to limit the attributes exported to csv #15915 - plotXMLAttributes.py: Added options **--split-x** and **--split-y** for plotting attributes with list values #15934 - sumolib: Geometry helper functions for rotation at offset is now available #15445 - - duaIterate.py: When loading trips with taz or junction-taz, vehicles may change their depart and arrival edge in each iteration #15983 + - duaIterate.py: When loading trips with taz or junction-taz, vehicles may change their depart and arrival edge in each iteration #15983 + - filterDistricts.py: New options **--remove-ids** and **--remove-ids-file** allow filtering out explicit edges #16038 + - countEdgeUsage.py: print output on number loaded / filtered routes when option **--verbose** is set #16040 + - countEdgeUsage.py: New option **--subpart.via** allow filtering subparts with gaps (i.e. via edges) #16041 + - netdiff.py: Modified file edges for generated polygons to simplify file filtering in netedit #16042 + - poly2edgedata.py: Added new tool to transform traffic data from polygons (i.e. from geojson) to edgedata (i.e. for routeSampler.py) #16051 ### Miscellaneous From f3d7f72112a77ff016caa44f1877e992d8ae8cbf Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 13:05:06 +0100 Subject: [PATCH 090/116] added tests refs #21, #16066 --- tests/tools/config.tools | 2 ++ .../gzipped_input/additional.tools | 10 ++++++++++ .../edgesInDistricts/gzipped_input/errors.tools | 0 .../gzipped_input/input_districts.xml.gz | Bin 0 -> 327 bytes .../gzipped_input/input_net.net.xml.gz | Bin 0 -> 1860 bytes .../edgesInDistricts/gzipped_input/options.tools | 1 + .../edgesInDistricts/gzipped_input/output.tools | 0 .../district/edgesInDistricts/testsuite.tools | 3 +++ 8 files changed, 16 insertions(+) create mode 100644 tests/tools/district/edgesInDistricts/gzipped_input/additional.tools create mode 100644 tests/tools/district/edgesInDistricts/gzipped_input/errors.tools create mode 100644 tests/tools/district/edgesInDistricts/gzipped_input/input_districts.xml.gz create mode 100644 tests/tools/district/edgesInDistricts/gzipped_input/input_net.net.xml.gz create mode 100644 tests/tools/district/edgesInDistricts/gzipped_input/options.tools create mode 100644 tests/tools/district/edgesInDistricts/gzipped_input/output.tools diff --git a/tests/tools/config.tools b/tests/tools/config.tools index cd4549c3bea2..d96bdc1f5ed4 100644 --- a/tests/tools/config.tools +++ b/tests/tools/config.tools @@ -11,6 +11,7 @@ copy_test_path:input_additional.add.xml copy_test_path:input_additional2.add.xml copy_test_path:three_split.net.xml copy_test_path:input_net.net.xml +copy_test_path:input_net.net.xml.gz copy_test_path:input_edges.edg.xml copy_test_path:input_nodes.nod.xml copy_test_path:input_plain.tll.xml @@ -45,6 +46,7 @@ copy_test_path:testLinks.txt copy_test_path:routesx.rou.alt.xml copy_test_path:routesy.rou.alt.xml copy_test_path:input_districts.xml +copy_test_path:input_districts.xml.gz copy_test_path:input_mtx0708.fma copy_test_path:vissim.inp copy_test_path:e1.add.xml diff --git a/tests/tools/district/edgesInDistricts/gzipped_input/additional.tools b/tests/tools/district/edgesInDistricts/gzipped_input/additional.tools new file mode 100644 index 000000000000..a950efe53219 --- /dev/null +++ b/tests/tools/district/edgesInDistricts/gzipped_input/additional.tools @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/tests/tools/district/edgesInDistricts/gzipped_input/errors.tools b/tests/tools/district/edgesInDistricts/gzipped_input/errors.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/district/edgesInDistricts/gzipped_input/input_districts.xml.gz b/tests/tools/district/edgesInDistricts/gzipped_input/input_districts.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..dcf24c79f799cfc0e92f3f1e62c77894723dbff2 GIT binary patch literal 327 zcmV-N0l5AjiwFP!0000018q;iQo=A0z4t5DTs3XdT7?dU@t`Nr1K>Dbn2;=xnKtP( zg`!_?D2m9K!_M2y+xPYjM*FgW9o9};lM@~?0%)XF+N^UjpFPnY84ZJAa78Js(O@ka zRA3FnEKVuoG){oW*=?MqDJ(zWQ5L##2-ErG1q^z!Zs7H(4?Dhy`GQ^Z{@pEICHHZ{ z)hd;}fYO79P@e30q5yxDaoOJKoNSt=%A%-k+ptYSTd$*-F&@25##6b$Qc!JNBaB1> zo}U@}EJ}2hka+wbTPd0@-M5n4mNryH9V(3WPDQ`AiWeCrbiuBPz@ZO+&_Rx(b)DL-Z1Mm4LK`t#eYNBGH99p4552eBN5Ao>p ZXYFLQEVg*?8k}Vw24B#MNvi|`000LaoqPZQ literal 0 HcmV?d00001 diff --git a/tests/tools/district/edgesInDistricts/gzipped_input/input_net.net.xml.gz b/tests/tools/district/edgesInDistricts/gzipped_input/input_net.net.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..e61e605bb9309235d553d4c0b22c3eb36eb4874c GIT binary patch literal 1860 zcmV-K2fO$miwFP!000001HDttZ`&Xgzvr)Dz5}+iN>${fhkZzs+U?MF+O4AS?66_5 zcu*((>xb^du0o)NIpDQ%l|_VE2Pz0Phni$(R0 zQqq70F9ImyEGhHyisl6^m!v3H@2^(NYx1-wpQOZl?S~oFK4u{Ez#nle=I@^ZOtvK)dp7l%Se8bB;FZj>9+k3f%R#0s*2rD5YseWbM zSJ47?Lc(-@>*UCJV#3%uri^C__zo4nWPqiEEJY>hskH54*o@!fTBuZ>iiDxHHh|<= zmM&5Q0j zP>-V;pEMIG8{VYInwO(!#ShM>m5bp#$F%YP+#C%|%g#Fqi0R*&S!%$w5d5CC+EOo+ zj>u}gV_s;}i~Xt9wJ->0&3#3R9c>a62H@NEuC6h8Ov%KP0cxFZh0!n5?{`22AJ0Js z>aZ179Sic;aPv6R)~{&gz=ksd>u8AH3h$y-_@>SY%B1sY&ZvTrI`EI|U&ThZI*bAo zJAji-ng;D0<3XmGX`&IH8exIT7%qgGML1jX9@*cn+b%h7<XR4vKJ@$)LhS%n-#U2A@9A(JgolZm>0;!f`jb=__HneDuAE2rD0u5U--ea)sHA zg~0X0#WKLoVj*gh>l}_ z5fVaAdQ+fdJ2Osf$y~1jH`++Ago)U>4KsdCq_rFI&=6^Z|4=Dn5{)5=9+ko==g_-MxqFnMrRD_I#oKws@ML5W4DA)+u&w{El;&h9yhaDGj z4gP{o*uAp!MJ0k%Ed(31c$5AdTH-*^-*ThLmdo{9AU33lb==6h<6;&CBp(EBdyQV~_es#i z7IPCSOadx*synOSTBRR%0I8TG5pe5xqaO)&hqOlBvN>NNyGReInR~YCM45>MEnX2V z;QCCIlVn9qQ&HA>F)+*MwEck@ZNmpk`-7pF+cVWH;6U%-<1U=@4BLE{YIer6#g>g3 zuH3{3f^P;v9bJLZr~A9nH{M%~j?{jTtumBmFVul|R<|ASAqIJQc*fQ@JBN&0Io7K@ z`2vi>u}*=mN>^&}<8*2%HBBZMu@2~u^dQyf`xP~< z7MU8~WUI0vZj!@EMHKVfXGgh7>a8bW>O*a>qGUi84I?H_3qWt(5;uO^0_uVy z`9x9SrJE%<8&jV7+L)dAL|3Pva^ZKuloy>*T*Xi!Yc@$8Qgs?NOC;MvU0(R5hat@x zqb*v}-I?B^fuw^Y6jC)7=oL$Pj6~+idq($2O^?hvr9{i~b%Ak57B6;@;L>kFCDp&i z0lw!_508vnjXEi4WYK!9A@c2iHI-_!h8t}o7_UgQJ_G$|eAi0kftOWj{e7Q&6^G3& z5i{uiGNpHBvN?6It>ln&SQ`4bJk{SjWqG}G$ho0STRiit1Y=a2dFWXu!ccC2)=s6E1bu9CpS?JA25~_VW1G zs|Vf@0U6L)5kXLUT-812WPR=fa6p&#mfMCA_Mw^F*kr+sjrkjAn<6lCS2&#PJ^Nb4 yQh)b4o!0h*6t6ue={Unwe(s*6-3(N<*L`+b+K0fymi*)B>EVBbE3a9@8UO%0Gp2_C literal 0 HcmV?d00001 diff --git a/tests/tools/district/edgesInDistricts/gzipped_input/options.tools b/tests/tools/district/edgesInDistricts/gzipped_input/options.tools new file mode 100644 index 000000000000..0d9a1a80c819 --- /dev/null +++ b/tests/tools/district/edgesInDistricts/gzipped_input/options.tools @@ -0,0 +1 @@ +-n input_net.net.xml.gz -t input_districts.xml.gz -o out.add.xml -s diff --git a/tests/tools/district/edgesInDistricts/gzipped_input/output.tools b/tests/tools/district/edgesInDistricts/gzipped_input/output.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/district/edgesInDistricts/testsuite.tools b/tests/tools/district/edgesInDistricts/testsuite.tools index 55370df94bce..6d98e0d5e6bd 100644 --- a/tests/tools/district/edgesInDistricts/testsuite.tools +++ b/tests/tools/district/edgesInDistricts/testsuite.tools @@ -14,3 +14,6 @@ group_by_param # aggregating input by id prefix group_by_prefix + +# one simple network +gzipped_input From 9485604f7bf70eb73a2c51f6c018e5884001d197 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 13:06:24 +0100 Subject: [PATCH 091/116] fix #16066 --- tools/edgesInDistricts.py | 6 ++---- tools/sumolib/shapes/polygon.py | 11 +++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/edgesInDistricts.py b/tools/edgesInDistricts.py index fd92da2f132b..832f8b1b372f 100755 --- a/tools/edgesInDistricts.py +++ b/tools/edgesInDistricts.py @@ -197,12 +197,10 @@ def parse_args(args=None): "taz only.") dec = DistrictEdgeComputer(sumolib.net.readNet(nets[0])) tazFiles = nets + options.taz_files.split(",") - polyReader = sumolib.shapes.polygon.PolygonReader(True) - for tf in tazFiles: - parse(tf, polyReader) + polygons = sumolib.shapes.polygon.read(tazFiles, includeTaz=True) if options.verbose: print("Calculating") - dec.computeWithin(polyReader.getPolygons(), options) + dec.computeWithin(polygons, options) if options.verbose: print("Writing results") dec.writeResults(options) diff --git a/tools/sumolib/shapes/polygon.py b/tools/sumolib/shapes/polygon.py index 92b05b7a2778..40d701ad11ab 100644 --- a/tools/sumolib/shapes/polygon.py +++ b/tools/sumolib/shapes/polygon.py @@ -127,7 +127,10 @@ def getPolygons(self): return self._polys -def read(filename, includeTaz=False): - polys = PolygonReader(includeTaz) - parse(filename, polys) - return polys.getPolygons() +def read(filenames, includeTaz=False): + pr = PolygonReader(includeTaz) + if isinstance(filenames, str): + filenames = [filenames] + for fn in filenames: + parse(miscutils.openz(fn), pr) + return pr.getPolygons() From a5193d49905899a74b686e467b279047ddf5e334 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 13:16:02 +0100 Subject: [PATCH 092/116] fix #16062 --- src/netbuild/NBEdgeCont.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netbuild/NBEdgeCont.cpp b/src/netbuild/NBEdgeCont.cpp index e9f845ed1b7f..7ccf004aaaaa 100644 --- a/src/netbuild/NBEdgeCont.cpp +++ b/src/netbuild/NBEdgeCont.cpp @@ -822,7 +822,7 @@ void NBEdgeCont::checkGeometries(const double maxAngle, bool fixAngle, const double minRadius, bool fix, bool fixRailways, bool silent) { if (maxAngle > 0 || minRadius > 0) { for (auto& item : myEdges) { - if (isSidewalk(item.second->getPermissions()) || isForbidden(item.second->getPermissions())) { + if ((item.second->getPermissions() & (SVC_PUBLIC_CLASSES | SVC_PASSENGER)) == 0) { continue; } item.second->checkGeometry(maxAngle, fixAngle, minRadius, fix || (fixRailways && isRailway(item.second->getPermissions())), silent); From d9494d11e96a43524c36aef18ddd68e1efe9ade2 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 13:16:07 +0100 Subject: [PATCH 093/116] patching expected results refs #21, #16062 --- .../export/amitran/adlershof_dlr/errors.netconvert | 5 ----- .../crossings/guessed/adlershof_dlr/errors.netconvert | 8 -------- .../junctions.join/adlershof_dlr/errors.netconvert | 5 ----- .../tls_programs/bike_edges/4arm_rw/errors.netconvert | 2 -- .../bike_edges/4arm_rw_ignoreJam/errors.netconvert | 2 -- .../import/OSM/adlershof_dlr_sidewalks/errors.netconvert | 6 ------ .../OSM/adlershof_dlr_sidewalks_option/errors.netconvert | 8 -------- .../netconvert/import/OSM/bike_access/errors.netconvert | 6 ------ .../import/OSM/bugs/ticket11839/errors.netconvert | 1 - .../import/OSM/bugs/ticket12592/errors.netconvert | 6 ------ .../import/OSM/bugs/ticket14766/errors.netconvert | 1 - .../import/OSM/bugs/ticket15150/errors.netconvert | 1 - .../import/OSM/bugs/ticket2790/errors.netconvert | 8 -------- .../import/OSM/bugs/ticket6495/errors.netconvert | 2 -- .../import/OSM/bugs/ticket8587/errors.netconvert | 9 --------- .../import/OSM/bugs/ticket8791/errors.netconvert | 3 --- tests/netconvert/import/OSM/bus_lanes/errors.netconvert | 6 ------ .../complex_intermodal_intersection/errors.netconvert | 2 -- .../import/OSM/difficult_geometry/errors.netconvert | 2 -- tests/netconvert/import/OSM/dlr_navteq/errors.netconvert | 4 ---- .../import/OSM/dlr_navteq_version/errors.netconvert | 4 ---- tests/netconvert/import/OSM/join_tram/errors.netconvert | 7 ------- .../import/OSM/maxspeed/motorway/errors.netconvert | 1 - .../motorway_overrideUnlimited/errors.netconvert | 1 - tests/netconvert/import/OSM/oerlikon/errors.netconvert | 3 --- .../OSM/public_transport/aerialway/errors.netconvert | 4 ---- .../bus_stop_direction_from_pt_lines/errors.netconvert | 4 ---- .../bus_stop_mix_stops_platforms/errors.netconvert | 4 ---- .../errors.netconvert | 4 ---- .../public_transport/duplicate_lines/errors.netconvert | 4 ---- .../ptline_network_modification/errors.netconvert | 4 ---- .../OSM/public_transport/trolleybus/errors.netconvert | 2 -- .../OSM/railway/rail_stop_road_access/errors.netconvert | 6 ------ .../import/OSM/tostmannplatz/errors.netconvert | 1 - .../OSM/turn_lanes/service_target/errors.netconvert | 2 -- .../adlershof_dlr_deprecated_vclass/errors.netconvert | 8 -------- .../netconvert/meta/aggregate_warnings/errors.netconvert | 3 --- tests/tools/import/OSM/taxiStop/fleet0_1/errors.tools | 8 ++------ tests/tools/import/OSM/taxiStop/fleet1/errors.tools | 8 ++------ tests/tools/import/OSM/taxiStop/gz/errors.tools | 2 -- tests/tools/import/OSM/taxiStop/plain/errors.tools | 8 ++------ tests/tools/import/OSM/webWizard/errors.tools | 7 +------ 42 files changed, 7 insertions(+), 175 deletions(-) diff --git a/tests/netconvert/export/amitran/adlershof_dlr/errors.netconvert b/tests/netconvert/export/amitran/adlershof_dlr/errors.netconvert index 658643727d8a..aa9b0dd5ec49 100644 --- a/tests/netconvert/export/amitran/adlershof_dlr/errors.netconvert +++ b/tests/netconvert/export/amitran/adlershof_dlr/errors.netconvert @@ -1,8 +1,3 @@ Warning: Ambiguous node type for node cluster 'cluster_1568241251_260702783' (priority,right_before_left), setting to 'priority'. Warning: Ambiguous node type for node cluster 'cluster_1568241533_283018932_607638014' (right_before_left,priority), setting to 'priority'. Warning: Ambiguous node type for node cluster 'cluster_1568241686_2177702824' (priority,right_before_left), setting to 'priority'. -Warning: Found sharp turn with radius 4.30 at the end of edge '-133858467#1'. -Warning: Found sharp turn with radius 4.30 at the start of edge '133858467#1'. -Warning: Found sharp turn with radius 4.73 at the start of edge '143308685#1'. -Warning: Found sharp turn with radius 6.42 at the start of edge '47765615#1'. -Warning: Found sharp turn with radius 2.03 at the start of edge '70214888#3'. diff --git a/tests/netconvert/function/crossings/guessed/adlershof_dlr/errors.netconvert b/tests/netconvert/function/crossings/guessed/adlershof_dlr/errors.netconvert index 68124178bb99..546cf52a3958 100644 --- a/tests/netconvert/function/crossings/guessed/adlershof_dlr/errors.netconvert +++ b/tests/netconvert/function/crossings/guessed/adlershof_dlr/errors.netconvert @@ -1,12 +1,4 @@ -Warning: Found sharp turn with radius 4.30 at the end of edge '-133858467#1'. -Warning: Found angle of 178.89 degrees at edge '-70214888#0', segment 0. -Warning: Found sharp turn with radius 0.02 at the start of edge '-70214888#0'. -Warning: Found sharp turn with radius 4.30 at the start of edge '133858467#1'. -Warning: Found sharp turn with radius 4.73 at the start of edge '143308685#1'. -Warning: Found angle of 178.89 degrees at edge '156071615#4', segment 0. -Warning: Found sharp turn with radius 0.04 at the start of edge '156071615#4'. Warning: Speed of straight connection '-143308521#0_1->38915289_1' reduced by 6.06 due to turning radius of 47.50 (length=17.36, angle=36.30). Warning: Speed of straight connection '-142575679#0_1->38915289_1' reduced by 5.62 due to turning radius of 50.10 (length=19.42, angle=37.57). Warning: Speed of straight connection '-38915289_1->143308521#0_1' reduced by 5.14 due to turning radius of 53.02 (length=19.41, angle=36.30). Warning: Speed of straight connection '-73058506#1_1->-73058506#0_1' reduced by 5.06 due to turning radius of 14.19 (length=5.80, angle=39.82). -Warning: 7 total messages of type: Found sharp turn with radius % at the % of edge '%'. diff --git a/tests/netconvert/function/junctions.join/adlershof_dlr/errors.netconvert b/tests/netconvert/function/junctions.join/adlershof_dlr/errors.netconvert index 658643727d8a..aa9b0dd5ec49 100644 --- a/tests/netconvert/function/junctions.join/adlershof_dlr/errors.netconvert +++ b/tests/netconvert/function/junctions.join/adlershof_dlr/errors.netconvert @@ -1,8 +1,3 @@ Warning: Ambiguous node type for node cluster 'cluster_1568241251_260702783' (priority,right_before_left), setting to 'priority'. Warning: Ambiguous node type for node cluster 'cluster_1568241533_283018932_607638014' (right_before_left,priority), setting to 'priority'. Warning: Ambiguous node type for node cluster 'cluster_1568241686_2177702824' (priority,right_before_left), setting to 'priority'. -Warning: Found sharp turn with radius 4.30 at the end of edge '-133858467#1'. -Warning: Found sharp turn with radius 4.30 at the start of edge '133858467#1'. -Warning: Found sharp turn with radius 4.73 at the start of edge '143308685#1'. -Warning: Found sharp turn with radius 6.42 at the start of edge '47765615#1'. -Warning: Found sharp turn with radius 2.03 at the start of edge '70214888#3'. diff --git a/tests/netconvert/function/tls_programs/bike_edges/4arm_rw/errors.netconvert b/tests/netconvert/function/tls_programs/bike_edges/4arm_rw/errors.netconvert index 3172041b7380..1351fd69a83c 100644 --- a/tests/netconvert/function/tls_programs/bike_edges/4arm_rw/errors.netconvert +++ b/tests/netconvert/function/tls_programs/bike_edges/4arm_rw/errors.netconvert @@ -1,5 +1,3 @@ -Warning: Found sharp turn with radius 5.48 at the end of edge '-177182139#0'. -Warning: Found sharp turn with radius 5.48 at the start of edge '35084893#1'. Warning: The traffic light 'joinedS_2453091696_cluster_1537334946_2453091683_7202621463_8355251671_#1more_cluster_2453091662_2453091707_31532419_31532420_#1more' cannot be adapted to a cycle time of 90.00. Warning: The traffic light 'joinedS_2453091696_cluster_1537334946_2453091683_7202621463_8355251671_#1more_cluster_2453091662_2453091707_31532419_31532420_#1more' has a high cycle time of 280.00. Warning: The traffic light 'joinedS_2453091696_cluster_1537334946_2453091683_7202621463_8355251671_#1more_cluster_2453091662_2453091707_31532419_31532420_#1more' cannot be adapted to a cycle time of 90.00. diff --git a/tests/netconvert/function/tls_programs/bike_edges/4arm_rw_ignoreJam/errors.netconvert b/tests/netconvert/function/tls_programs/bike_edges/4arm_rw_ignoreJam/errors.netconvert index 6921748764a5..e69de29bb2d1 100644 --- a/tests/netconvert/function/tls_programs/bike_edges/4arm_rw_ignoreJam/errors.netconvert +++ b/tests/netconvert/function/tls_programs/bike_edges/4arm_rw_ignoreJam/errors.netconvert @@ -1,2 +0,0 @@ -Warning: Found sharp turn with radius 5.48 at the end of edge '-177182139#0'. -Warning: Found sharp turn with radius 5.48 at the start of edge '35084893#1'. diff --git a/tests/netconvert/import/OSM/adlershof_dlr_sidewalks/errors.netconvert b/tests/netconvert/import/OSM/adlershof_dlr_sidewalks/errors.netconvert index 51f8fa763bd1..1bfc6d67bea5 100644 --- a/tests/netconvert/import/OSM/adlershof_dlr_sidewalks/errors.netconvert +++ b/tests/netconvert/import/OSM/adlershof_dlr_sidewalks/errors.netconvert @@ -24,11 +24,6 @@ Warning: Removing pt stop '663346697' on non existing edge ''. Warning: Removing pt stop '735390157' on non existing edge ''. Warning: Removing pt stop '852932403' on non existing edge ''. Warning: Removed 5 pt stops because they could not be assigned to the network -Warning: Found sharp turn with radius 4.30 at the end of edge '-133858467#1'. -Warning: Found sharp turn with radius 7.22 at the start of edge '-133858467#2'. -Warning: Found sharp turn with radius 4.30 at the start of edge '133858467#1'. -Warning: Found sharp turn with radius 4.73 at the start of edge '143308685#1'. -Warning: Found sharp turn with radius 6.42 at the start of edge '47765615#1'. Warning: Shape for junction '158710676' has distance 21.60 to its given position. Warning: Could not find edge for parkingArea '46039050#2'. Warning: Could not find edge for parkingArea '46039050#3'. @@ -42,6 +37,5 @@ Warning: Ignoring parking area on edge '143308521#6' due to insufficient space. Warning: Ignoring parking area on edge '-143308521#6' due to insufficient space. Warning: 18 total messages of type: Could not find edge for parkingArea '%'. Warning: 9 total messages of type: Discarding unknown compound '%' in type '%' (first occurrence for edge '%'). -Warning: 6 total messages of type: Found sharp turn with radius % at the % of edge '%'. Warning: 12 total messages of type: Ignoring parking area on edge '%' due to insufficient space. Warning: 10 total messages of type: PT line '%' in relation % seems to be split, only keeping first part. diff --git a/tests/netconvert/import/OSM/adlershof_dlr_sidewalks_option/errors.netconvert b/tests/netconvert/import/OSM/adlershof_dlr_sidewalks_option/errors.netconvert index 5a82f408ac23..8fdb0193f9ab 100644 --- a/tests/netconvert/import/OSM/adlershof_dlr_sidewalks_option/errors.netconvert +++ b/tests/netconvert/import/OSM/adlershof_dlr_sidewalks_option/errors.netconvert @@ -24,14 +24,6 @@ Warning: Removing pt stop '663346697' on non existing edge ''. Warning: Removing pt stop '735390157' on non existing edge ''. Warning: Removing pt stop '852932403' on non existing edge ''. Warning: Removed 5 pt stops because they could not be assigned to the network -Warning: Found sharp turn with radius 4.30 at the end of edge '-133858467#1'. -Warning: Found sharp turn with radius 7.22 at the start of edge '-133858467#2'. -Warning: Found sharp turn with radius 4.20 at the end of edge '-245105014'. -Warning: Found angle of 138.43 degrees at edge '-71960638#0', segment 0. -Warning: Found sharp turn with radius 4.30 at the start of edge '133858467#1'. -Warning: Found sharp turn with radius 4.73 at the start of edge '143308685#1'. -Warning: Found angle of 138.43 degrees at edge '71960638#0', segment 5. Warning: Shape for junction '158710676' has distance 21.60 to its given position. Warning: 9 total messages of type: Discarding unknown compound '%' in type '%' (first occurrence for edge '%'). -Warning: 8 total messages of type: Found sharp turn with radius % at the % of edge '%'. Warning: 10 total messages of type: PT line '%' in relation % seems to be split, only keeping first part. diff --git a/tests/netconvert/import/OSM/bike_access/errors.netconvert b/tests/netconvert/import/OSM/bike_access/errors.netconvert index cdbe88c67094..b8e1f84c1745 100644 --- a/tests/netconvert/import/OSM/bike_access/errors.netconvert +++ b/tests/netconvert/import/OSM/bike_access/errors.netconvert @@ -1,8 +1,2 @@ -Warning: Found angle of 111.46 degrees at edge '-69607680', segment 1. -Warning: Found angle of 111.93 degrees at edge '-69607680', segment 2. -Warning: Found sharp turn with radius 7.03 at the end of edge '-69607680'. -Warning: Found sharp turn with radius 7.03 at the start of edge '69607680'. -Warning: Found angle of 111.93 degrees at edge '69607680', segment 1. -Warning: Found angle of 111.46 degrees at edge '69607680', segment 2. Warning: The traffic light '138559856' does not control any links; it will not be build. Warning: Could not build program '0' for traffic light '138559856' diff --git a/tests/netconvert/import/OSM/bugs/ticket11839/errors.netconvert b/tests/netconvert/import/OSM/bugs/ticket11839/errors.netconvert index 46ef4a1b408d..44d05c77f9ba 100644 --- a/tests/netconvert/import/OSM/bugs/ticket11839/errors.netconvert +++ b/tests/netconvert/import/OSM/bugs/ticket11839/errors.netconvert @@ -1,4 +1,3 @@ Warning: Discarding unknown compound 'cycleway.lane' in type 'cycleway.lane|highway.secondary' (first occurrence for edge '4612858'). Warning: Discarding unknown compound 'cycleway.lane' in type 'cycleway.lane|highway.cycleway' (first occurrence for edge '961646415'). Warning: Discarding unknown compound 'cycleway.track' in type 'cycleway.track|highway.cycleway' (first occurrence for edge '961646427'). -Warning: Found sharp turn with radius 7.38 at the start of edge '386659490#1'. diff --git a/tests/netconvert/import/OSM/bugs/ticket12592/errors.netconvert b/tests/netconvert/import/OSM/bugs/ticket12592/errors.netconvert index 95e6c8a73bd3..c688aeecf107 100644 --- a/tests/netconvert/import/OSM/bugs/ticket12592/errors.netconvert +++ b/tests/netconvert/import/OSM/bugs/ticket12592/errors.netconvert @@ -34,14 +34,8 @@ Warning: Removing pt stop '5132952924' on non existing edge ''. Warning: Removing pt stop '5132952925' on non existing edge ''. Warning: Removing pt stop '5132952926' on non existing edge ''. Warning: Removed 6 pt stops because they could not be assigned to the network -Warning: Found sharp turn with radius 7.87 at the start of edge '-15217456#0'. -Warning: Found sharp turn with radius 4.50 at the start of edge '-360264840'. -Warning: Found sharp turn with radius 2.17 at the start of edge '-360264845'. -Warning: Found sharp turn with radius 3.21 at the start of edge '-420450643'. -Warning: Found sharp turn with radius 1.33 at the end of edge '-420450643'. Warning: Edge '957112906' is not connected to outgoing edges at junction '8116258616'. Warning: 17 total messages of type: Discarding way '%' because it has only % node(s) -Warning: 10 total messages of type: Found sharp turn with radius % at the % of edge '%'. Warning: 32 total messages of type: PT line in relation % with no stops ignored. Probably OSM file is incomplete. Warning: 7 total messages of type: PT stop '%' has been moved to edge '%'. Warning: 6 total messages of type: Removing pt stop '%' on non existing edge '%'. diff --git a/tests/netconvert/import/OSM/bugs/ticket14766/errors.netconvert b/tests/netconvert/import/OSM/bugs/ticket14766/errors.netconvert index 973b79884d4b..7b6264e58a26 100644 --- a/tests/netconvert/import/OSM/bugs/ticket14766/errors.netconvert +++ b/tests/netconvert/import/OSM/bugs/ticket14766/errors.netconvert @@ -4,4 +4,3 @@ Warning: Discarding unknown compound 'cycleway.lane' in type 'cycleway.lane|high Warning: Referenced platform: '385969276' in relation: '1119037' is corrupt. Probably OSM file is incomplete. Warning: Referenced platform: '385969276' in relation: '1119037' is corrupt. Probably OSM file is incomplete. Warning: PT stop '837697309' has been moved to edge '-70130312#0'. -Warning: Found sharp turn with radius 2.97 at the end of edge '69923037#0'. diff --git a/tests/netconvert/import/OSM/bugs/ticket15150/errors.netconvert b/tests/netconvert/import/OSM/bugs/ticket15150/errors.netconvert index d789e467832f..33c6e1cab543 100644 --- a/tests/netconvert/import/OSM/bugs/ticket15150/errors.netconvert +++ b/tests/netconvert/import/OSM/bugs/ticket15150/errors.netconvert @@ -27,7 +27,6 @@ Warning: No way found for reference '4254135033' in relation '6749958' Warning: No way found for reference '1860841058' in relation '6749958' Warning: PT line in relation 7026678 with no stops ignored. Probably OSM file is incomplete. Warning: No way found for reference '4254135033' in relation '11882449' -Warning: Found sharp turn with radius 8.33 at the end of edge '1004914191#1'. Warning: The traffic light 'joinedS_cluster_11737663837_2822414390_28300252_28300261_#15more_cluster_1860841058_3822937545_cluster_1860841069_1860841070_1860841073_277870595_#7more' cannot be adapted to a cycle time of 90.00. Warning: The traffic light 'joinedS_cluster_11737663837_2822414390_28300252_28300261_#15more_cluster_1860841058_3822937545_cluster_1860841069_1860841070_1860841073_277870595_#7more' has a high cycle time of 318.00. Warning: 132 total messages of type: Discarding way '%' because it has only % node(s) diff --git a/tests/netconvert/import/OSM/bugs/ticket2790/errors.netconvert b/tests/netconvert/import/OSM/bugs/ticket2790/errors.netconvert index 3572cfbc101f..8ecf1d3a1ad6 100644 --- a/tests/netconvert/import/OSM/bugs/ticket2790/errors.netconvert +++ b/tests/netconvert/import/OSM/bugs/ticket2790/errors.netconvert @@ -1,12 +1,4 @@ Warning: Ambiguity in turnarounds computation at junction '1123455766'. Warning: Ambiguity in turnarounds computation at junction '2027445712'. -Warning: Found angle of 128.20 degrees at edge '-209812787', segment 18. -Warning: Found angle of 178.67 degrees at edge '-209812787', segment 19. -Warning: Found angle of 103.29 degrees at edge '-221896851', segment 7. -Warning: Found sharp turn with radius 7.36 at the end of edge '-221896851'. -Warning: Found angle of 178.67 degrees at edge '209812787', segment 9. -Warning: Found angle of 128.20 degrees at edge '209812787', segment 10. -Warning: Found sharp turn with radius 7.36 at the start of edge '221896851'. Warning: Found sharp turn with radius 8.15 at the start of edge '293506780'. Warning: Found sharp turn with radius 8.15 at the end of edge '293506788'. -Warning: 6 total messages of type: Found angle of % degrees at edge '%', segment %. diff --git a/tests/netconvert/import/OSM/bugs/ticket6495/errors.netconvert b/tests/netconvert/import/OSM/bugs/ticket6495/errors.netconvert index 7b09c4f86036..5f1ed7e16cdb 100644 --- a/tests/netconvert/import/OSM/bugs/ticket6495/errors.netconvert +++ b/tests/netconvert/import/OSM/bugs/ticket6495/errors.netconvert @@ -31,11 +31,9 @@ Warning: Not joining junctions 4333150952,443847,660638854 (not compact (maxEdge Warning: Ambiguity in turnarounds computation at junction '2201773661'. Warning: Ambiguity in turnarounds computation at junction '7022635681'. Warning: Ambiguity in turnarounds computation at junction 'cluster_370556673_370556675'. -Warning: Found angle of 110.88 degrees at edge '-691079998', segment 0. Warning: Found sharp turn with radius 5.51 at the start of edge '-8225153#1'. Warning: Found sharp turn with radius 8.58 at the end of edge '-8225153#2'. Warning: Found angle of 101.17 degrees at edge '23686956#2', segment 0. -Warning: Found angle of 110.88 degrees at edge '399092215#1', segment 2. Warning: Found sharp turn with radius 5.51 at the end of edge '8225153#1'. Warning: Found sharp turn with radius 8.58 at the start of edge '8225153#2'. Warning: The traffic light '1496363648' does not control any links; it will not be build. diff --git a/tests/netconvert/import/OSM/bugs/ticket8587/errors.netconvert b/tests/netconvert/import/OSM/bugs/ticket8587/errors.netconvert index 8291b89f4512..020b516c26ec 100644 --- a/tests/netconvert/import/OSM/bugs/ticket8587/errors.netconvert +++ b/tests/netconvert/import/OSM/bugs/ticket8587/errors.netconvert @@ -1,12 +1,3 @@ Warning: PT stop '7307151972' has been moved to edge '-5067106#3'. Warning: Ambiguity in turnarounds computation at junction '2289508334'. Warning: Ambiguity in turnarounds computation at junction '2289508776'. -Warning: Found angle of 177.81 degrees at edge '-27778180#1', segment 1. -Warning: Found angle of 177.28 degrees at edge '-27778180#1', segment 2. -Warning: Found sharp turn with radius 2.21 at the end of edge '-27778180#1'. -Warning: Found angle of 136.94 degrees at edge '-36825527#0', segment 0. -Warning: Found angle of 136.94 degrees at edge '156640650#4', segment 0. -Warning: Found sharp turn with radius 8.37 at the start of edge '156775063#3'. -Warning: Found angle of 177.28 degrees at edge '27778180#0', segment 0. -Warning: Found sharp turn with radius 2.21 at the start of edge '27778180#0'. -Warning: 6 total messages of type: Found angle of % degrees at edge '%', segment %. diff --git a/tests/netconvert/import/OSM/bugs/ticket8791/errors.netconvert b/tests/netconvert/import/OSM/bugs/ticket8791/errors.netconvert index 699a53e25e10..5323c3d12d08 100644 --- a/tests/netconvert/import/OSM/bugs/ticket8791/errors.netconvert +++ b/tests/netconvert/import/OSM/bugs/ticket8791/errors.netconvert @@ -11,9 +11,6 @@ Warning: PT stop '8341032348' has been moved to edge '-19431426#9'. Warning: PT stop '2705494849' has been moved to edge '-39546438'. Warning: PT stop '1711953916' has been moved to edge '-11646390'. Warning: Cannot assign stop 1711974496 on edge '206357901' to pt line '3651123'. Ignoring! -Warning: Found sharp turn with radius 6.32 at the start of edge '-387523449'. -Warning: Found sharp turn with radius 7.22 at the start of edge '-848475453'. -Warning: Found sharp turn with radius 7.22 at the end of edge '848475453'. Warning: The traffic light '2696124617' does not control any links; it will not be build. Warning: Could not build program '0' for traffic light '2696124617' Warning: The traffic light '665421850' does not control any links; it will not be build. diff --git a/tests/netconvert/import/OSM/bus_lanes/errors.netconvert b/tests/netconvert/import/OSM/bus_lanes/errors.netconvert index cdbe88c67094..b8e1f84c1745 100644 --- a/tests/netconvert/import/OSM/bus_lanes/errors.netconvert +++ b/tests/netconvert/import/OSM/bus_lanes/errors.netconvert @@ -1,8 +1,2 @@ -Warning: Found angle of 111.46 degrees at edge '-69607680', segment 1. -Warning: Found angle of 111.93 degrees at edge '-69607680', segment 2. -Warning: Found sharp turn with radius 7.03 at the end of edge '-69607680'. -Warning: Found sharp turn with radius 7.03 at the start of edge '69607680'. -Warning: Found angle of 111.93 degrees at edge '69607680', segment 1. -Warning: Found angle of 111.46 degrees at edge '69607680', segment 2. Warning: The traffic light '138559856' does not control any links; it will not be build. Warning: Could not build program '0' for traffic light '138559856' diff --git a/tests/netconvert/import/OSM/complex_intermodal_intersection/errors.netconvert b/tests/netconvert/import/OSM/complex_intermodal_intersection/errors.netconvert index 8f85ace037f4..b903698c460d 100644 --- a/tests/netconvert/import/OSM/complex_intermodal_intersection/errors.netconvert +++ b/tests/netconvert/import/OSM/complex_intermodal_intersection/errors.netconvert @@ -1,5 +1,3 @@ -Warning: Found sharp turn with radius 8.56 at the end of edge '-526422275'. -Warning: Found sharp turn with radius 8.56 at the start of edge '526422275'. Warning: Edge '394077080' is not connected to outgoing edges at junction '3815833412'. Warning: The traffic light '3815833412' does not control any links; it will not be build. Warning: Could not build program '0' for traffic light '3815833412' diff --git a/tests/netconvert/import/OSM/difficult_geometry/errors.netconvert b/tests/netconvert/import/OSM/difficult_geometry/errors.netconvert index e407ec564554..69b1b6252359 100644 --- a/tests/netconvert/import/OSM/difficult_geometry/errors.netconvert +++ b/tests/netconvert/import/OSM/difficult_geometry/errors.netconvert @@ -7,5 +7,3 @@ Warning: PT line in relation 35497 with no stops ignored. Probably OSM file is i Warning: PT line in relation 35503 with no stops ignored. Probably OSM file is incomplete. Warning: Invalid color value 'FF0000' in relation 215740 Warning: PT stop '473567360' has been moved to edge '438511759#1'. -Warning: Found sharp turn with radius 5.42 at the end of edge '-109647392'. -Warning: Found sharp turn with radius 5.42 at the start of edge '109647392'. diff --git a/tests/netconvert/import/OSM/dlr_navteq/errors.netconvert b/tests/netconvert/import/OSM/dlr_navteq/errors.netconvert index 31179ce539e8..5e35c806b032 100644 --- a/tests/netconvert/import/OSM/dlr_navteq/errors.netconvert +++ b/tests/netconvert/import/OSM/dlr_navteq/errors.netconvert @@ -7,10 +7,6 @@ Warning: Discarding unknown compound 'cycleway.track' in type 'cycleway.track|hi Warning: Discarding unknown compound 'cycleway.lane' in type 'cycleway.lane|highway.tertiary' (first occurrence for edge '81096583'). Warning: No way found for reference '320741893' in relation '3422297' Warning: Ignoring restriction relation '3422297' with unknown to-way. -Warning: Found sharp turn with radius 6.56 at the end of edge '415852877'. -Warning: Found angle of 138.43 degrees at edge '415852893', segment 0. -Warning: Found sharp turn with radius 6.56 at the start of edge '415852968'. -Warning: Found angle of 138.43 degrees at edge '415852994', segment 5. Warning: ambiguous zip code '12489;12345' for edge '415852867'. (using first value) Warning: ambiguous zip code '12489;12345' for edge '415852868'. (using first value) Warning: ambiguous zip code '12489;12345' for edge '415852869'. (using first value) diff --git a/tests/netconvert/import/OSM/dlr_navteq_version/errors.netconvert b/tests/netconvert/import/OSM/dlr_navteq_version/errors.netconvert index 31179ce539e8..5e35c806b032 100644 --- a/tests/netconvert/import/OSM/dlr_navteq_version/errors.netconvert +++ b/tests/netconvert/import/OSM/dlr_navteq_version/errors.netconvert @@ -7,10 +7,6 @@ Warning: Discarding unknown compound 'cycleway.track' in type 'cycleway.track|hi Warning: Discarding unknown compound 'cycleway.lane' in type 'cycleway.lane|highway.tertiary' (first occurrence for edge '81096583'). Warning: No way found for reference '320741893' in relation '3422297' Warning: Ignoring restriction relation '3422297' with unknown to-way. -Warning: Found sharp turn with radius 6.56 at the end of edge '415852877'. -Warning: Found angle of 138.43 degrees at edge '415852893', segment 0. -Warning: Found sharp turn with radius 6.56 at the start of edge '415852968'. -Warning: Found angle of 138.43 degrees at edge '415852994', segment 5. Warning: ambiguous zip code '12489;12345' for edge '415852867'. (using first value) Warning: ambiguous zip code '12489;12345' for edge '415852868'. (using first value) Warning: ambiguous zip code '12489;12345' for edge '415852869'. (using first value) diff --git a/tests/netconvert/import/OSM/join_tram/errors.netconvert b/tests/netconvert/import/OSM/join_tram/errors.netconvert index 444d4b2b514b..5363ce5b6c2c 100644 --- a/tests/netconvert/import/OSM/join_tram/errors.netconvert +++ b/tests/netconvert/import/OSM/join_tram/errors.netconvert @@ -19,13 +19,7 @@ Warning: PT stop '3901927130' has been moved to edge '-32035133'. Warning: Ambiguity in turnarounds computation at junction '2526575765'. Warning: Ambiguity in turnarounds computation at junction '632909234'. Warning: Ambiguity in turnarounds computation at junction '768038181'. -Warning: Found angle of 99.21 degrees at edge '-24685976', segment 0. -Warning: Found sharp turn with radius 7.06 at the end of edge '-49809488#0'. -Warning: Found sharp turn with radius 8.19 at the end of edge '-552943165#1'. -Warning: Found sharp turn with radius 8.23 at the start of edge '-679528241'. Warning: Found sharp turn with radius 8.78 at the start of edge '197740390#1'. -Warning: Found angle of 99.21 degrees at edge '24685976', segment 1. -Warning: Found sharp turn with radius 7.06 at the start of edge '49809488#0'. Warning: Converting invalid rail_crossing to priority junction '1428640919'. Warning: Converting invalid rail_crossing to priority junction '1828307001'. Warning: Converting invalid rail_crossing to priority junction '1828354123'. @@ -38,4 +32,3 @@ Warning: The rail crossing '1828327717' does not have any roads. Warning: The rail crossing '30695381' does not have any roads. Warning: 8 total messages of type: Converting invalid rail_crossing to priority junction '%'. Warning: 11 total messages of type: Discarding unknown compound '%' in type '%' (first occurrence for edge '%'). -Warning: 7 total messages of type: Found sharp turn with radius % at the % of edge '%'. diff --git a/tests/netconvert/import/OSM/maxspeed/motorway/errors.netconvert b/tests/netconvert/import/OSM/maxspeed/motorway/errors.netconvert index e2d3c4dbf6a9..769e11d6c9f1 100644 --- a/tests/netconvert/import/OSM/maxspeed/motorway/errors.netconvert +++ b/tests/netconvert/import/OSM/maxspeed/motorway/errors.netconvert @@ -1,6 +1,5 @@ Warning: Discarding unusable type 'waterway.drain' (first occurrence for edge '25797909'). Warning: Discarding unusable type 'waterway.stream' (first occurrence for edge '44530101'). -Warning: Found sharp turn with radius 4.40 at the start of edge '231469974#2'. Warning: Shape for junction '1649753799' has distance 20.74 to its given position. Warning: Shape for junction '205498344' has distance 28.41 to its given position. Warning: Shape for junction '98169359' has distance 26.65 to its given position. diff --git a/tests/netconvert/import/OSM/maxspeed/motorway_overrideUnlimited/errors.netconvert b/tests/netconvert/import/OSM/maxspeed/motorway_overrideUnlimited/errors.netconvert index e2d3c4dbf6a9..769e11d6c9f1 100644 --- a/tests/netconvert/import/OSM/maxspeed/motorway_overrideUnlimited/errors.netconvert +++ b/tests/netconvert/import/OSM/maxspeed/motorway_overrideUnlimited/errors.netconvert @@ -1,6 +1,5 @@ Warning: Discarding unusable type 'waterway.drain' (first occurrence for edge '25797909'). Warning: Discarding unusable type 'waterway.stream' (first occurrence for edge '44530101'). -Warning: Found sharp turn with radius 4.40 at the start of edge '231469974#2'. Warning: Shape for junction '1649753799' has distance 20.74 to its given position. Warning: Shape for junction '205498344' has distance 28.41 to its given position. Warning: Shape for junction '98169359' has distance 26.65 to its given position. diff --git a/tests/netconvert/import/OSM/oerlikon/errors.netconvert b/tests/netconvert/import/OSM/oerlikon/errors.netconvert index ddeb768f009c..3d89294a7bd1 100644 --- a/tests/netconvert/import/OSM/oerlikon/errors.netconvert +++ b/tests/netconvert/import/OSM/oerlikon/errors.netconvert @@ -50,10 +50,7 @@ Warning: Removing pt stop '5710994954' on non existing edge ''. Warning: Removed 4 pt stops because they could not be assigned to the network Warning: Ambiguous tram edges '12089777#1' and '219012222' for lane '-163302813#0_0'. Warning: Ambiguous tram edges '218990870#0' and '219014586#1' for lane '163302813#0_0'. -Warning: Found sharp turn with radius 5.09 at the start of edge '-926136448'. Warning: Found sharp turn with radius 8.40 at the start of edge '11990237#0'. -Warning: Found sharp turn with radius 3.69 at the start of edge '137132908#4'. -Warning: Found sharp turn with radius 5.40 at the start of edge '42922205'. Warning: Converting invalid rail_crossing to priority junction '10268308575'. Warning: Converting invalid rail_crossing to priority junction '10268308584'. Warning: Converting invalid rail_crossing to priority junction '10268336874'. diff --git a/tests/netconvert/import/OSM/public_transport/aerialway/errors.netconvert b/tests/netconvert/import/OSM/public_transport/aerialway/errors.netconvert index 4b04317c942a..e7054006254e 100644 --- a/tests/netconvert/import/OSM/public_transport/aerialway/errors.netconvert +++ b/tests/netconvert/import/OSM/public_transport/aerialway/errors.netconvert @@ -2,10 +2,6 @@ Warning: Cannot revise pt stop localization for pt line '6491411', which consist Warning: Removed invalid stop '8647924360' from line '6491411'. Warning: Removing pt stop '8647924360' on non existing edge ''. Warning: Removed 1 pt stops because they could not be assigned to the network -Warning: Found sharp turn with radius 5.35 at the start of edge '-376621077'. -Warning: Found sharp turn with radius 4.17 at the start of edge '-458565760'. -Warning: Found sharp turn with radius 5.35 at the end of edge '376621077'. -Warning: Found sharp turn with radius 4.17 at the end of edge '458565760'. Warning: Converting invalid rail_crossing to priority junction '1436665652'. Warning: Converting invalid rail_crossing to priority junction '4100631378'. Warning: Converting invalid rail_crossing to priority junction '4100631384'. diff --git a/tests/netconvert/import/OSM/public_transport/bus_stop_direction_from_pt_lines/errors.netconvert b/tests/netconvert/import/OSM/public_transport/bus_stop_direction_from_pt_lines/errors.netconvert index fded1fc6e8b9..5dbe5b3575fc 100644 --- a/tests/netconvert/import/OSM/public_transport/bus_stop_direction_from_pt_lines/errors.netconvert +++ b/tests/netconvert/import/OSM/public_transport/bus_stop_direction_from_pt_lines/errors.netconvert @@ -13,10 +13,6 @@ Warning: PT stop '3959807220' has been moved to edge '-110450334#1'. Warning: PT stop '4032629820' has been moved to edge '-53356539#0'. Warning: Cannot assign stop 3959807201 on edge '391493954' to pt line '6187328'. Ignoring! Warning: Cannot assign stop 3959807200 on edge '391493954' to pt line '6187329'. Ignoring! -Warning: Found sharp turn with radius 3.48 at the start of edge '-338392750'. -Warning: Found sharp turn with radius 6.74 at the start of edge '-41292662#2'. -Warning: Found sharp turn with radius 4.75 at the start of edge '187160639'. -Warning: Found sharp turn with radius 6.45 at the start of edge '338392750'. Warning: The traffic light '29325954' does not control any links; it will not be build. Warning: Could not build program '0' for traffic light '29325954' Warning: The traffic light '29325955' does not control any links; it will not be build. diff --git a/tests/netconvert/import/OSM/public_transport/bus_stop_mix_stops_platforms/errors.netconvert b/tests/netconvert/import/OSM/public_transport/bus_stop_mix_stops_platforms/errors.netconvert index 7df86d3577d3..b329b9136c74 100644 --- a/tests/netconvert/import/OSM/public_transport/bus_stop_mix_stops_platforms/errors.netconvert +++ b/tests/netconvert/import/OSM/public_transport/bus_stop_mix_stops_platforms/errors.netconvert @@ -26,14 +26,10 @@ Warning: PT stop '4701534129' has been moved to edge '-66924592#7'. Warning: PT stop '4701534132' has been moved to edge '-66924592#4'. Warning: Found sharp turn with radius 2.22 at the start of edge '-24787423'. Warning: Found sharp turn with radius 2.22 at the end of edge '24787423'. -Warning: Found sharp turn with radius 3.44 at the end of edge '572772262'. -Warning: Found sharp turn with radius 3.34 at the start of edge '722316229'. -Warning: Found sharp turn with radius 5.80 at the start of edge '743127577'. Warning: Speed of straight connection '24546642#0_0->24546642#1_0' reduced by 6.42 due to turning radius of 8.89 (length=1.23, angle=23.69). Warning: Speed of straight connection '253362218_0->253362220#0_0' reduced by 7.47 due to turning radius of 6.42 (length=4.51, angle=60.95). Warning: Speed of straight connection '300873532#2_0->300873532#3_0' reduced by 8.92 due to turning radius of 3.67 (length=1.07, angle=36.47). Warning: Speed of straight connection '300873532#2_1->300873532#3_1' reduced by 7.31 due to turning radius of 6.77 (length=2.24, angle=36.47). -Warning: 6 total messages of type: Found sharp turn with radius % at the % of edge '%'. Warning: 6 total messages of type: No way found for reference '%' in relation '%' Warning: 9 total messages of type: PT line in relation % with no stops ignored. Probably OSM file is incomplete. Warning: 8 total messages of type: PT stop '%' has been moved to edge '%'. diff --git a/tests/netconvert/import/OSM/public_transport/bus_stop_mix_stops_platforms_lefthand/errors.netconvert b/tests/netconvert/import/OSM/public_transport/bus_stop_mix_stops_platforms_lefthand/errors.netconvert index 03b80eab7c20..a5e150c81ca9 100644 --- a/tests/netconvert/import/OSM/public_transport/bus_stop_mix_stops_platforms_lefthand/errors.netconvert +++ b/tests/netconvert/import/OSM/public_transport/bus_stop_mix_stops_platforms_lefthand/errors.netconvert @@ -26,13 +26,9 @@ Warning: PT stop '4701534129' has been moved to edge '-66924592#7'. Warning: PT stop '4701534132' has been moved to edge '-66924592#4'. Warning: Found sharp turn with radius 2.22 at the start of edge '-24787423'. Warning: Found sharp turn with radius 2.22 at the end of edge '24787423'. -Warning: Found sharp turn with radius 3.44 at the end of edge '572772262'. -Warning: Found sharp turn with radius 3.34 at the start of edge '722316229'. -Warning: Found sharp turn with radius 5.80 at the start of edge '743127577'. Warning: Speed of straight connection '24546642#0_0->24546642#1_0' reduced by 5.99 due to turning radius of 10.02 (length=1.40, angle=23.69). Warning: Speed of straight connection '300873532#2_0->300873532#3_0' reduced by 7.31 due to turning radius of 6.77 (length=2.24, angle=36.47). Warning: Speed of straight connection '300873532#2_1->300873532#3_1' reduced by 8.92 due to turning radius of 3.67 (length=1.07, angle=36.47). -Warning: 6 total messages of type: Found sharp turn with radius % at the % of edge '%'. Warning: 6 total messages of type: No way found for reference '%' in relation '%' Warning: 9 total messages of type: PT line in relation % with no stops ignored. Probably OSM file is incomplete. Warning: 8 total messages of type: PT stop '%' has been moved to edge '%'. diff --git a/tests/netconvert/import/OSM/public_transport/duplicate_lines/errors.netconvert b/tests/netconvert/import/OSM/public_transport/duplicate_lines/errors.netconvert index 447032b2e2eb..192bbf93319e 100644 --- a/tests/netconvert/import/OSM/public_transport/duplicate_lines/errors.netconvert +++ b/tests/netconvert/import/OSM/public_transport/duplicate_lines/errors.netconvert @@ -24,10 +24,6 @@ Warning: PT stop '3959807220' has been moved to edge '-110450334#1'. Warning: PT stop '4032629820' has been moved to edge '-53356539#0'. Warning: Cannot assign stop 3959807201 on edge '391493954' to pt line '6187328'. Ignoring! Warning: Cannot assign stop 3959807200 on edge '391493954' to pt line '6187329'. Ignoring! -Warning: Found sharp turn with radius 3.48 at the start of edge '-338392750'. -Warning: Found sharp turn with radius 6.74 at the start of edge '-41292662#2'. -Warning: Found sharp turn with radius 4.75 at the start of edge '187160639'. -Warning: Found sharp turn with radius 6.45 at the start of edge '338392750'. Warning: The traffic light '29325954' does not control any links; it will not be build. Warning: Could not build program '0' for traffic light '29325954' Warning: The traffic light '29325955' does not control any links; it will not be build. diff --git a/tests/netconvert/import/OSM/public_transport/ptline_network_modification/errors.netconvert b/tests/netconvert/import/OSM/public_transport/ptline_network_modification/errors.netconvert index 8867551f0fee..5dbe5b3575fc 100644 --- a/tests/netconvert/import/OSM/public_transport/ptline_network_modification/errors.netconvert +++ b/tests/netconvert/import/OSM/public_transport/ptline_network_modification/errors.netconvert @@ -13,10 +13,6 @@ Warning: PT stop '3959807220' has been moved to edge '-110450334#1'. Warning: PT stop '4032629820' has been moved to edge '-53356539#0'. Warning: Cannot assign stop 3959807201 on edge '391493954' to pt line '6187328'. Ignoring! Warning: Cannot assign stop 3959807200 on edge '391493954' to pt line '6187329'. Ignoring! -Warning: Found sharp turn with radius 6.74 at the start of edge '-41292662#2'. -Warning: Found sharp turn with radius 6.45 at the end of edge '186519599'. -Warning: Found sharp turn with radius 4.75 at the start of edge '187160639'. -Warning: Found sharp turn with radius 6.45 at the start of edge '338392750'. Warning: The traffic light '29325954' does not control any links; it will not be build. Warning: Could not build program '0' for traffic light '29325954' Warning: The traffic light '29325955' does not control any links; it will not be build. diff --git a/tests/netconvert/import/OSM/public_transport/trolleybus/errors.netconvert b/tests/netconvert/import/OSM/public_transport/trolleybus/errors.netconvert index bb0bd31c0da8..b8623f789ea5 100644 --- a/tests/netconvert/import/OSM/public_transport/trolleybus/errors.netconvert +++ b/tests/netconvert/import/OSM/public_transport/trolleybus/errors.netconvert @@ -12,6 +12,4 @@ Warning: Removing pt stop '5635232641' on non existing edge ''. Warning: Removing pt stop '7064021220' on non existing edge ''. Warning: Removing pt stop '7064021221' on non existing edge ''. Warning: Removed 4 pt stops because they could not be assigned to the network -Warning: Found sharp turn with radius 5.63 at the start of edge '-1225386536#1'. -Warning: Found sharp turn with radius 7.19 at the start of edge '1225386536#1'. Warning: 23 total messages of type: PT line in relation % with no stops ignored. Probably OSM file is incomplete. diff --git a/tests/netconvert/import/OSM/railway/rail_stop_road_access/errors.netconvert b/tests/netconvert/import/OSM/railway/rail_stop_road_access/errors.netconvert index 8005f1fd5603..f7e95eb5fc5f 100644 --- a/tests/netconvert/import/OSM/railway/rail_stop_road_access/errors.netconvert +++ b/tests/netconvert/import/OSM/railway/rail_stop_road_access/errors.netconvert @@ -11,14 +11,8 @@ Warning: PT stop '344853528' has been moved to edge '-37850032#0'. Warning: PT stop '3812676497' has been moved to edge '-93704176#0'. Warning: PT stop '3895454719' has been moved to edge '-93704176#0'. Warning: PT stop '3812676489' has been moved to edge '403449586#0'. -Warning: Found sharp turn with radius 5.27 at the start of edge '-176023638#0'. -Warning: Found sharp turn with radius 6.44 at the start of edge '-50319231#0'. -Warning: Found sharp turn with radius 3.17 at the end of edge '-57898977'. -Warning: Found sharp turn with radius 7.49 at the start of edge '174644656#6'. -Warning: Found sharp turn with radius 8.31 at the start of edge '384545670'. Warning: Converting invalid rail_crossing to priority junction '3094848230'. Warning: Converting invalid rail_crossing to priority junction '3094848231'. Warning: Converting invalid rail_crossing to priority junction '3094848232'. Warning: The rail crossing '1865677206' does not have any roads. Warning: 7 total messages of type: Discarding unknown compound '%' in type '%' (first occurrence for edge '%'). -Warning: 8 total messages of type: Found sharp turn with radius % at the % of edge '%'. diff --git a/tests/netconvert/import/OSM/tostmannplatz/errors.netconvert b/tests/netconvert/import/OSM/tostmannplatz/errors.netconvert index 9ace29e9d63e..156d1ddbd89a 100644 --- a/tests/netconvert/import/OSM/tostmannplatz/errors.netconvert +++ b/tests/netconvert/import/OSM/tostmannplatz/errors.netconvert @@ -8,4 +8,3 @@ Warning: Not joining junctions 2663214240,4002570893 (only 1 exit node). Warning: Ambiguity in turnarounds computation at junction 'cluster_2663214238_273542034_273542611_3445436408_#4more'. Warning: Ambiguity in turnarounds computation at junction 'cluster_273542494_3445436416_3445436418_5458979046_#4more'. Warning: Ambiguity in turnarounds computation at junction 'cluster_31130912_8943896893'. -Warning: Found sharp turn with radius 8.35 at the end of edge '337455349#4'. diff --git a/tests/netconvert/import/OSM/turn_lanes/service_target/errors.netconvert b/tests/netconvert/import/OSM/turn_lanes/service_target/errors.netconvert index b1370e011091..6aed37979eda 100644 --- a/tests/netconvert/import/OSM/turn_lanes/service_target/errors.netconvert +++ b/tests/netconvert/import/OSM/turn_lanes/service_target/errors.netconvert @@ -1,4 +1,2 @@ Warning: PT line in relation 15097874 with no stops ignored. Probably OSM file is incomplete. Warning: PT stop '7096121260' has been moved to edge '-288968955#1'. -Warning: Found sharp turn with radius 2.74 at the start of edge '-110364720#1'. -Warning: Found sharp turn with radius 2.74 at the end of edge '110364720#1'. diff --git a/tests/netconvert/import/SUMO/adlershof_dlr_deprecated_vclass/errors.netconvert b/tests/netconvert/import/SUMO/adlershof_dlr_deprecated_vclass/errors.netconvert index f8cb5f657d47..55ab805cf6d8 100644 --- a/tests/netconvert/import/SUMO/adlershof_dlr_deprecated_vclass/errors.netconvert +++ b/tests/netconvert/import/SUMO/adlershof_dlr_deprecated_vclass/errors.netconvert @@ -1,9 +1 @@ Warning: Deprecated vehicle class(es) 'cityrail' in input network. -Warning: Found sharp turn with radius 4.30 at the end of edge '-133858467#1'. -Warning: Found angle of 178.89 degrees at edge '-70214888#0', segment 0. -Warning: Found sharp turn with radius 0.02 at the start of edge '-70214888#0'. -Warning: Found sharp turn with radius 4.30 at the start of edge '133858467#1'. -Warning: Found sharp turn with radius 4.73 at the start of edge '143308685#1'. -Warning: Found angle of 178.89 degrees at edge '156071615#4', segment 0. -Warning: Found sharp turn with radius 0.04 at the start of edge '156071615#4'. -Warning: 7 total messages of type: Found sharp turn with radius % at the % of edge '%'. diff --git a/tests/netconvert/meta/aggregate_warnings/errors.netconvert b/tests/netconvert/meta/aggregate_warnings/errors.netconvert index 42b56632c7d9..c8c7fa856602 100644 --- a/tests/netconvert/meta/aggregate_warnings/errors.netconvert +++ b/tests/netconvert/meta/aggregate_warnings/errors.netconvert @@ -13,8 +13,6 @@ Warning: PT stop '1553912606' has been moved to edge '-141968830#1'. Warning: Removing pt stop '588394564' on non existing edge ''. Warning: Removing pt stop '588394578' on non existing edge ''. Warning: Removed 5 pt stops because they could not be assigned to the network -Warning: Found sharp turn with radius 4.30 at the end of edge '-133858467#1'. -Warning: Found sharp turn with radius 7.22 at the start of edge '-133858467#2'. Warning: Could not find edge for parkingArea '46039050#2'. Warning: Could not find edge for parkingArea '46039050#3'. Warning: Ignoring parking area on edge '142575693#3' due to insufficient space. @@ -22,7 +20,6 @@ Warning: Ignoring parking area on edge '142575693#4' due to insufficient space. Warning: 18 total messages of type: Could not find edge for parkingArea '%'. Warning: 9 total messages of type: Discarding unknown compound '%' in type '%' (first occurrence for edge '%'). Warning: 3 total messages of type: Discarding unusable type '%' (first occurrence for edge '%'). -Warning: 6 total messages of type: Found sharp turn with radius % at the % of edge '%'. Warning: 12 total messages of type: Ignoring parking area on edge '%' due to insufficient space. Warning: 10 total messages of type: PT line '%' in relation % seems to be split, only keeping first part. Warning: 3 total messages of type: PT stop '%' has been moved to edge '%'. diff --git a/tests/tools/import/OSM/taxiStop/fleet0_1/errors.tools b/tests/tools/import/OSM/taxiStop/fleet0_1/errors.tools index 245a710c2dbf..b4fecf18eac8 100644 --- a/tests/tools/import/OSM/taxiStop/fleet0_1/errors.tools +++ b/tests/tools/import/OSM/taxiStop/fleet0_1/errors.tools @@ -76,11 +76,8 @@ Warning: Not joining junctions 2933657337,2933662031 (parallel outgoing 28983006 Warning: Ambiguity in turnarounds computation at junction '1206481791'. Warning: Ambiguity in turnarounds computation at junction '1206481808'. Warning: Ambiguity in turnarounds computation at junction '5527777343'. -Warning: Found sharp turn with radius 5.72 at the end of edge '-285825377'. -Warning: Found sharp turn with radius 6.74 at the start of edge '-330832908'. -Warning: Found sharp turn with radius 8.20 at the start of edge '-409507435#2'. -Warning: Found sharp turn with radius 6.39 at the start of edge '-52348720#0'. -Warning: Found sharp turn with radius 4.03 at the start of edge '-553121566#2'. +Warning: Found sharp turn with radius 6.03 at the start of edge '122820534#0'. +Warning: Found sharp turn with radius 8.49 at the start of edge '23852053#1'. Warning: Found angle of 179.72 degrees at edge '32590429', segment 0. Warning: Found angle of 179.79 degrees at edge '32590435#1', segment 11. Warning: The rail crossing '1157325170' does not have any roads. @@ -96,7 +93,6 @@ Warning: 16 total messages of type: Converting invalid rail_crossing to priority Warning: 10 total messages of type: Could not re-assign PT stop '%', probably broken osm file. Warning: 13 total messages of type: Discarding unknown compound '%' in type '%' (first occurrence for edge '%'). Warning: 15 total messages of type: Discarding unusable type '%' (first occurrence for edge '%'). -Warning: 9 total messages of type: Found sharp turn with radius % at the % of edge '%'. Warning: 15 total messages of type: No way found for reference '%' in relation '%' Warning: 6 total messages of type: Not joining junctions % (%). Warning: 17 total messages of type: PT line in relation % with no stops ignored. Probably OSM file is incomplete. diff --git a/tests/tools/import/OSM/taxiStop/fleet1/errors.tools b/tests/tools/import/OSM/taxiStop/fleet1/errors.tools index 245a710c2dbf..b4fecf18eac8 100644 --- a/tests/tools/import/OSM/taxiStop/fleet1/errors.tools +++ b/tests/tools/import/OSM/taxiStop/fleet1/errors.tools @@ -76,11 +76,8 @@ Warning: Not joining junctions 2933657337,2933662031 (parallel outgoing 28983006 Warning: Ambiguity in turnarounds computation at junction '1206481791'. Warning: Ambiguity in turnarounds computation at junction '1206481808'. Warning: Ambiguity in turnarounds computation at junction '5527777343'. -Warning: Found sharp turn with radius 5.72 at the end of edge '-285825377'. -Warning: Found sharp turn with radius 6.74 at the start of edge '-330832908'. -Warning: Found sharp turn with radius 8.20 at the start of edge '-409507435#2'. -Warning: Found sharp turn with radius 6.39 at the start of edge '-52348720#0'. -Warning: Found sharp turn with radius 4.03 at the start of edge '-553121566#2'. +Warning: Found sharp turn with radius 6.03 at the start of edge '122820534#0'. +Warning: Found sharp turn with radius 8.49 at the start of edge '23852053#1'. Warning: Found angle of 179.72 degrees at edge '32590429', segment 0. Warning: Found angle of 179.79 degrees at edge '32590435#1', segment 11. Warning: The rail crossing '1157325170' does not have any roads. @@ -96,7 +93,6 @@ Warning: 16 total messages of type: Converting invalid rail_crossing to priority Warning: 10 total messages of type: Could not re-assign PT stop '%', probably broken osm file. Warning: 13 total messages of type: Discarding unknown compound '%' in type '%' (first occurrence for edge '%'). Warning: 15 total messages of type: Discarding unusable type '%' (first occurrence for edge '%'). -Warning: 9 total messages of type: Found sharp turn with radius % at the % of edge '%'. Warning: 15 total messages of type: No way found for reference '%' in relation '%' Warning: 6 total messages of type: Not joining junctions % (%). Warning: 17 total messages of type: PT line in relation % with no stops ignored. Probably OSM file is incomplete. diff --git a/tests/tools/import/OSM/taxiStop/gz/errors.tools b/tests/tools/import/OSM/taxiStop/gz/errors.tools index defb81d866d1..73d869f663ea 100644 --- a/tests/tools/import/OSM/taxiStop/gz/errors.tools +++ b/tests/tools/import/OSM/taxiStop/gz/errors.tools @@ -21,8 +21,6 @@ Warning: Converting invalid rail_crossing to traffic_light at junction '39186739 Warning: Converting invalid rail_crossing to traffic_light at junction '3918673907'. Warning: Converting invalid rail_crossing to traffic_light at junction '3918673909'. Warning: Converting invalid rail_crossing to priority junction '4402536776'. -Warning: Found sharp turn with radius 6.39 at the start of edge '-52348720#0'. -Warning: Found sharp turn with radius 6.39 at the end of edge '52348720#0'. Warning: The rail crossing '4567083492' does not have any roads. Warning: The rail crossing '4567083494' does not have any roads. Warning: The rail crossing '4603660236' does not have any roads. diff --git a/tests/tools/import/OSM/taxiStop/plain/errors.tools b/tests/tools/import/OSM/taxiStop/plain/errors.tools index 245a710c2dbf..b4fecf18eac8 100644 --- a/tests/tools/import/OSM/taxiStop/plain/errors.tools +++ b/tests/tools/import/OSM/taxiStop/plain/errors.tools @@ -76,11 +76,8 @@ Warning: Not joining junctions 2933657337,2933662031 (parallel outgoing 28983006 Warning: Ambiguity in turnarounds computation at junction '1206481791'. Warning: Ambiguity in turnarounds computation at junction '1206481808'. Warning: Ambiguity in turnarounds computation at junction '5527777343'. -Warning: Found sharp turn with radius 5.72 at the end of edge '-285825377'. -Warning: Found sharp turn with radius 6.74 at the start of edge '-330832908'. -Warning: Found sharp turn with radius 8.20 at the start of edge '-409507435#2'. -Warning: Found sharp turn with radius 6.39 at the start of edge '-52348720#0'. -Warning: Found sharp turn with radius 4.03 at the start of edge '-553121566#2'. +Warning: Found sharp turn with radius 6.03 at the start of edge '122820534#0'. +Warning: Found sharp turn with radius 8.49 at the start of edge '23852053#1'. Warning: Found angle of 179.72 degrees at edge '32590429', segment 0. Warning: Found angle of 179.79 degrees at edge '32590435#1', segment 11. Warning: The rail crossing '1157325170' does not have any roads. @@ -96,7 +93,6 @@ Warning: 16 total messages of type: Converting invalid rail_crossing to priority Warning: 10 total messages of type: Could not re-assign PT stop '%', probably broken osm file. Warning: 13 total messages of type: Discarding unknown compound '%' in type '%' (first occurrence for edge '%'). Warning: 15 total messages of type: Discarding unusable type '%' (first occurrence for edge '%'). -Warning: 9 total messages of type: Found sharp turn with radius % at the % of edge '%'. Warning: 15 total messages of type: No way found for reference '%' in relation '%' Warning: 6 total messages of type: Not joining junctions % (%). Warning: 17 total messages of type: PT line in relation % with no stops ignored. Probably OSM file is incomplete. diff --git a/tests/tools/import/OSM/webWizard/errors.tools b/tests/tools/import/OSM/webWizard/errors.tools index 7483422a1ce8..6bcb3fc7ae3d 100644 --- a/tests/tools/import/OSM/webWizard/errors.tools +++ b/tests/tools/import/OSM/webWizard/errors.tools @@ -81,11 +81,7 @@ Warning: Ambiguity in turnarounds computation at junction '1206481808'. Warning: Ambiguity in turnarounds computation at junction '1575952504'. Warning: Ambiguity in turnarounds computation at junction '1661927181'. Warning: Ambiguity in turnarounds computation at junction '196721246'. -Warning: Found sharp turn with radius 7.95 at the end of edge '-137085429'. -Warning: Found sharp turn with radius 7.81 at the end of edge '-150634670#0'. -Warning: Found sharp turn with radius 7.23 at the start of edge '-150634670#1'. -Warning: Found sharp turn with radius 5.72 at the end of edge '-285825377'. -Warning: Found sharp turn with radius 6.74 at the start of edge '-330832908'. +Warning: Found sharp turn with radius 6.03 at the start of edge '122820534#0'. Warning: Invalid pedestrian topology: crossing ':cluster_2010745295_2010745299_2045862310_4603453643_#2more_c3' across [-195411601#1 195411601#1 -4402228 4402228 165409971#1 -165409971#1] has no target. Warning: Discarding invalid crossing ':cluster_2010745295_2010745299_2045862310_4603453643_#2more_c0' at junction 'cluster_2010745295_2010745299_2045862310_4603453643_#2more' with edges [190447766#2] (no walkingarea found). Warning: Discarding invalid crossing ':cluster_2010745295_2010745299_2045862310_4603453643_#2more_c1' at junction 'cluster_2010745295_2010745299_2045862310_4603453643_#2more' with edges [190447768#1 195411601#0 -22820560#3 -165409971#2 195411594#0] (no walkingarea found). @@ -108,7 +104,6 @@ Warning: 12 total messages of type: Connection '%_%->%_%' is only %m short. Warning: 15 total messages of type: Converting invalid rail_crossing to priority junction '%'. Warning: 10 total messages of type: Could not re-assign PT stop '%', probably broken osm file. Warning: 13 total messages of type: Discarding unusable type '%' (first occurrence for edge '%'). -Warning: 14 total messages of type: Found sharp turn with radius % at the % of edge '%'. Warning: 15 total messages of type: No way found for reference '%' in relation '%' Warning: 17 total messages of type: PT line in relation % with no stops ignored. Probably OSM file is incomplete. Warning: 13 total messages of type: PT stop '%' has been moved to edge '%'. From 567b289def10662be41b6fd854b73cf24132a861 Mon Sep 17 00:00:00 2001 From: Mirko Barthauer Date: Thu, 23 Jan 2025 12:00:09 +0000 Subject: [PATCH 094/116] Translated using Weblate (Italian) Currently translated at 65.8% (1717 of 2606 strings) Translation: Eclipse SUMO/Applications Translate-URL: https://hosted.weblate.org/projects/eclipse-sumo/applications/it/ --- data/po/it_sumo.po | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/data/po/it_sumo.po b/data/po/it_sumo.po index a547ca157ea0..2b153a0277a4 100644 --- a/data/po/it_sumo.po +++ b/data/po/it_sumo.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: sumo\n" "Report-Msgid-Bugs-To: sumo-dev@eclipse.org\n" "POT-Creation-Date: 2025-01-06 11:22+0100\n" -"PO-Revision-Date: 2025-01-22 12:13+0000\n" +"PO-Revision-Date: 2025-01-23 12:23+0000\n" "Last-Translator: Mirko Barthauer \n" "Language-Team: Italian \n" @@ -3750,7 +3750,7 @@ msgstr "" #: src/microsim/cfmodels/MSCFModel_Krauss.cpp:58 msgid "Rounding 'sigmaStep' to % for vType '%'" -msgstr "" +msgstr "Arrotondo 'sigmaStep' a % per il tipo di veicolo '%'" #: src/microsim/cfmodels/MSCFModel_Rail.cpp:86 msgid "Unknown train type: %. Exiting!" @@ -3760,52 +3760,68 @@ msgstr "Tipo di treno sconosciuto: %. Uscita!" msgid "" "Invalid size of speedTable for vType '%' (at least 2 values are required)." msgstr "" +"Misura invalida della tabella di velocità (speedTable) del tipo di veicolo " +"'%' (bisogna contenere almeno 2 valori)." #: src/microsim/cfmodels/MSCFModel_Rail.cpp:116 msgid "Mismatching size of speedTable and tractionTable for vType '%'." msgstr "" +"Le misure della tabella di velocità (speedTable) e quella di trazione " +"(tractionTable) non coincidono nel tipo di veicolo '%'." #: src/microsim/cfmodels/MSCFModel_Rail.cpp:118 msgid "Mismatching size of speedTable and resistanceTable for vType '%'." msgstr "" +"Le misure della tabella di velocità (speedTable) e quella di resistenza (" +"resistanceTable ) non coincidono nel tipo di veicolo '%'." #: src/microsim/cfmodels/MSCFModel_Rail.cpp:136 msgid "Undefined maxPower for vType '%'." -msgstr "" +msgstr "Non è stato definito maxPower per il tipo di veicolo '%'." #: src/microsim/cfmodels/MSCFModel_Rail.cpp:138 msgid "Undefined maxTraction for vType '%'." -msgstr "" +msgstr "Non è stato definito maxTraction per il tipo di veicolo '%'." #: src/microsim/cfmodels/MSCFModel_Rail.cpp:141 msgid "" "Ignoring tractionTable because maxPower and maxTraction are set for vType " "'%'." msgstr "" +"La tabella di trazione (tractionTable) verrà ignorata perché maxPower e " +"maxTraction sono stati impostati per il tipo di veicolo '%'." #: src/microsim/cfmodels/MSCFModel_Rail.cpp:150 msgid "" "Some undefined resistance coefficients for vType '%' (requires " "resCoef_constant, resCoef_linear and resCoef_quadratic)" msgstr "" +"Ci sono dei coefficenti di resistenza non definiti nel tipo di veicolo '%' (" +"richiede resCoef_constant, resCoef_linear e resCoef_quadratic)" #: src/microsim/cfmodels/MSCFModel_Rail.cpp:153 msgid "" "Ignoring resistanceTable because resistance coefficients are set for vType " "'%'." msgstr "" +"La tabella di resistenza verrà ignorata perché i coefficienti di resistenza " +"sono stati impostati per il tipo di veicolo '%'." #: src/microsim/cfmodels/MSCFModel_Rail.cpp:157 msgid "" "Either tractionTable or maxPower must be defined for vType '%' with Rail " "model type '%'." msgstr "" +"O la tabelle di trazione (tractionTable) o maxPower deve essere impostato " +"per il tipo di veicolo '%' con il tipo di modello ferroviario '%'." #: src/microsim/cfmodels/MSCFModel_Rail.cpp:160 msgid "" "Either resistanceTable or resCoef_constant must be defined for vType '%' " "with Rail model type '%'." msgstr "" +"O la tabella di resistenza o resCoef_constant deve essere impostato per il " +"tipo di veicolo '%' con il tipo di modello ferroviario '%'." #: src/microsim/cfmodels/MSCFModel_Rail.cpp:337 msgid "" @@ -4132,28 +4148,32 @@ msgstr "L'intervallo dopo cui l'itinerario del veicolo deve essere aggiornato" #: src/microsim/devices/MSDevice_Routing.cpp:57 msgid "The rerouting period before depart" -msgstr "" +msgstr "L'intervallo di instradamento prima della partenza" #: src/microsim/devices/MSDevice_Routing.cpp:61 msgid "The weight of prior edge weights for exponential moving average" -msgstr "" +msgstr "La valutazione di pesi di archi previ per la media mobile esponentiale" #: src/microsim/devices/MSDevice_Routing.cpp:65 msgid "The number of steps for moving average weight of prior edge weights" -msgstr "" +msgstr "Il numero di passi per la media mobile del peso di pesi di archi previ" #: src/microsim/devices/MSDevice_Routing.cpp:69 msgid "The interval for updating the edge weights" -msgstr "" +msgstr "L'intervallo di aggiornamento dei pesi degli archi" #: src/microsim/devices/MSDevice_Routing.cpp:74 msgid "Use zones (districts) as routing start- and endpoints" msgstr "" +"Usa zone (distretti) come punti di inizio e di destinazione " +"dell'instradamento" #: src/microsim/devices/MSDevice_Routing.cpp:77 #: src/microsim/devices/MSTransportableDevice_Routing.cpp:51 msgid "Set routing flags (8 ignores temporary blockages)" msgstr "" +"Imposta segnali di instradamento (blocchi temporanei verrano ignorati con il " +"valore 8)" #: src/microsim/devices/MSDevice_Routing.cpp:80 msgid "" @@ -4176,7 +4196,7 @@ msgstr "" #: src/microsim/devices/MSDevice_Routing.cpp:93 msgid "Compute separate average speeds for bicycles" -msgstr "" +msgstr "Calcola velocità medie separate per biciclette" #: src/microsim/devices/MSDevice_Routing.cpp:96 msgid "Save adapting weights to FILE" @@ -4194,12 +4214,12 @@ msgstr "" #: src/microsim/devices/MSDevice_Routing.cpp:112 msgid "Negative value for device.rerouting.adaptation-interval!" -msgstr "" +msgstr "Valore negativo per device.rerouting.adaptation-interval!" #: src/microsim/devices/MSDevice_Routing.cpp:117 msgid "" "The value for device.rerouting.adaptation-weight must be between 0 and 1!" -msgstr "" +msgstr "Il valore di device.rerouting.adaptation-weight deve essere tra 0 e 1!" #: src/microsim/devices/MSDevice_Routing.cpp:122 src/router/ROFrame.cpp:252 msgid "Parallel routing is only possible when compiled with Fox." From 18d5dc31ee1f4028b4962da3666d2f45f3371884 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 13:28:24 +0100 Subject: [PATCH 095/116] fix #16059 --- tools/webWizard/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/webWizard/script.js b/tools/webWizard/script.js index d6b6b26f26a3..0f9882558788 100644 --- a/tools/webWizard/script.js +++ b/tools/webWizard/script.js @@ -353,7 +353,8 @@ on("ready", function(){ elem("#lat_lon").value = lat.toFixed(6) + " " + lon.toFixed(6); } - var leftHandBounds = [new OpenLayers.Bounds(-9, 50, 3, 60), // British Isles + var leftHandBounds = [new OpenLayers.Bounds(-11,50,1,60), // British Isles + new OpenLayers.Bounds(0.774536,50.986099,1.779785,53.146770), // British Isles (part2) new OpenLayers.Bounds(66, 3, 90, 30), // India, Pakistan new OpenLayers.Bounds(95, -45, 179, 2), // Australia, Indonesia new OpenLayers.Bounds(-20, -35, 40, -15), // Southern Africa From aac325cbcaf5eced4b01c81356cfc0087b1039c2 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 13:43:14 +0100 Subject: [PATCH 096/116] added tests refs #21, #16063 --- .../sidewalks/divided_road/errors.netconvert | 1 + .../OSM/sidewalks/divided_road/net.netconvert | 72 ++++++++++++ .../sidewalks/divided_road/options.netconvert | 1 + .../OSM/sidewalks/divided_road/osm.netccfg | 29 +++++ .../import/OSM/sidewalks/divided_road/osm.xml | 107 ++++++++++++++++++ .../sidewalks/divided_road/output.netconvert | 1 + .../import/OSM/sidewalks/testsuite.netconvert | 3 + 7 files changed, 214 insertions(+) create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road/errors.netconvert create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road/net.netconvert create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road/options.netconvert create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road/osm.netccfg create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road/osm.xml create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road/output.netconvert diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road/errors.netconvert b/tests/netconvert/import/OSM/sidewalks/divided_road/errors.netconvert new file mode 100644 index 000000000000..c3b9348be129 --- /dev/null +++ b/tests/netconvert/import/OSM/sidewalks/divided_road/errors.netconvert @@ -0,0 +1 @@ +Warning: Shape for junction '1877290319' has distance 44.76 to its given position. diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road/net.netconvert b/tests/netconvert/import/OSM/sidewalks/divided_road/net.netconvert new file mode 100644 index 000000000000..f03fcb294259 --- /dev/null +++ b/tests/netconvert/import/OSM/sidewalks/divided_road/net.netconvert @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road/options.netconvert b/tests/netconvert/import/OSM/sidewalks/divided_road/options.netconvert new file mode 100644 index 000000000000..fbccec4be81f --- /dev/null +++ b/tests/netconvert/import/OSM/sidewalks/divided_road/options.netconvert @@ -0,0 +1 @@ +-c osm.netccfg \ No newline at end of file diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road/osm.netccfg b/tests/netconvert/import/OSM/sidewalks/divided_road/osm.netccfg new file mode 100644 index 000000000000..bf1f4cb0fd48 --- /dev/null +++ b/tests/netconvert/import/OSM/sidewalks/divided_road/osm.netccfg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road/osm.xml b/tests/netconvert/import/OSM/sidewalks/divided_road/osm.xml new file mode 100644 index 000000000000..59291465cc66 --- /dev/null +++ b/tests/netconvert/import/OSM/sidewalks/divided_road/osm.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road/output.netconvert b/tests/netconvert/import/OSM/sidewalks/divided_road/output.netconvert new file mode 100644 index 000000000000..a9d787cc55cb --- /dev/null +++ b/tests/netconvert/import/OSM/sidewalks/divided_road/output.netconvert @@ -0,0 +1 @@ +Success. diff --git a/tests/netconvert/import/OSM/sidewalks/testsuite.netconvert b/tests/netconvert/import/OSM/sidewalks/testsuite.netconvert index 40635322801b..e17786e27f62 100644 --- a/tests/netconvert/import/OSM/sidewalks/testsuite.netconvert +++ b/tests/netconvert/import/OSM/sidewalks/testsuite.netconvert @@ -3,3 +3,6 @@ bike_no_typemap import_left import_no_bike opposite + +# divided roads should not get sidewalks within +divided_road From f444187779217bb38b0a59998565ecc664b1c8f3 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 14:40:37 +0100 Subject: [PATCH 097/116] oneway defaults to single sidewalk unless changed by option. fix #16063 --- src/netimport/NIFrame.cpp | 3 +++ src/netimport/NIImporter_OpenStreetMap.cpp | 5 ++++- src/netimport/NIImporter_OpenStreetMap.h | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/netimport/NIFrame.cpp b/src/netimport/NIFrame.cpp index 1b89ebb76ab8..d047c98c443b 100644 --- a/src/netimport/NIFrame.cpp +++ b/src/netimport/NIFrame.cpp @@ -203,6 +203,9 @@ NIFrame::fillOptions(OptionsCont& oc, bool forNetedit) { oc.doRegister("osm.sidewalks", new Option_Bool(false)); oc.addDescription("osm.sidewalks", "Formats", TL("Import sidewalks")); + oc.doRegister("osm.oneway-reverse-sidewalk", new Option_Bool(false)); + oc.addDescription("osm.oneway-reverse-sidewalk", "Formats", TL("Default to building two sidewals on oneway streets (may affect divided roads)")); + oc.doRegister("osm.crossings", new Option_Bool(false)); oc.addDescription("osm.crossings", "Formats", TL("Import crossings")); diff --git a/src/netimport/NIImporter_OpenStreetMap.cpp b/src/netimport/NIImporter_OpenStreetMap.cpp index 00b7b3a6e0f9..1ffb27a499e2 100644 --- a/src/netimport/NIImporter_OpenStreetMap.cpp +++ b/src/netimport/NIImporter_OpenStreetMap.cpp @@ -140,6 +140,7 @@ NIImporter_OpenStreetMap::load(const OptionsCont& oc, NBNetBuilder& nb) { myImportSidewalks = oc.getBool("osm.sidewalks"); myImportBikeAccess = oc.getBool("osm.bike-access"); myImportCrossings = oc.getBool("osm.crossings"); + myOnewayDualSidewalk = oc.getBool("osm.oneway-reverse-sidewalk"); myAllAttributes = OptionsCont::getOptions().getBool("osm.all-attributes"); std::vector extra = OptionsCont::getOptions().getStringVector("osm.extra-attributes"); @@ -725,7 +726,9 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t WayType sidewalkType = e->mySidewalkType; // make a copy because we do some temporary modifications if (sidewalkType == WAY_UNKNOWN && (e->myExtraAllowed & SVC_PEDESTRIAN) != 0 && (permissions & SVC_PASSENGER) != 0) { // do not assume shared space unless sidewalk is actively disabled - sidewalkType = WAY_BOTH; + if (myOnewayDualSidewalk) { + sidewalkType = WAY_BOTH; + } } if (addSidewalk || (myImportSidewalks && (permissions & SVC_ROAD_CLASSES) != 0 && defaultPermissions != SVC_PEDESTRIAN)) { if (!addForward && (sidewalkType & WAY_FORWARD) != 0) { diff --git a/src/netimport/NIImporter_OpenStreetMap.h b/src/netimport/NIImporter_OpenStreetMap.h index f9a2f34772ea..631f43b59f46 100644 --- a/src/netimport/NIImporter_OpenStreetMap.h +++ b/src/netimport/NIImporter_OpenStreetMap.h @@ -312,6 +312,9 @@ class NIImporter_OpenStreetMap { /// @brief import sidewalks bool myImportSidewalks; + /// @brief import sidewalks + bool myOnewayDualSidewalk; + /// @brief import bike path specific permissions and directions bool myImportBikeAccess; From ab179f229a004bdb39a39ef2016e16cb32c0c68b Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 14:40:44 +0100 Subject: [PATCH 098/116] patching expected results refs #21, #16063 --- .../import/OSM/bugs/ticket6115/net.netconvert | 31 +- .../sidewalks/divided_road/errors.netconvert | 1 - .../OSM/sidewalks/divided_road/net.netconvert | 34 +- .../errors.netconvert | 1 + .../net.netconvert | 72 ++ .../options.netconvert | 1 + .../divided_road_reverseSidewalk/osm.netccfg | 29 + .../divided_road_reverseSidewalk/osm.xml | 107 ++ .../output.netconvert | 1 + .../import/OSM/sidewalks/testsuite.netconvert | 3 + .../OSM/tostmannplatz/errors.netconvert | 3 - .../import/OSM/tostmannplatz/net.netconvert | 1140 ++++++++--------- tests/netconvert/meta/help/output.netconvert | 5 +- .../cfg.netconvert | 5 +- .../meta/write_template_full/cfg.netconvert | 3 +- 15 files changed, 771 insertions(+), 665 deletions(-) create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/errors.netconvert create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/net.netconvert create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/options.netconvert create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/osm.netccfg create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/osm.xml create mode 100644 tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/output.netconvert diff --git a/tests/netconvert/import/OSM/bugs/ticket6115/net.netconvert b/tests/netconvert/import/OSM/bugs/ticket6115/net.netconvert index 35f8e3e9117a..154790c2445a 100644 --- a/tests/netconvert/import/OSM/bugs/ticket6115/net.netconvert +++ b/tests/netconvert/import/OSM/bugs/ticket6115/net.netconvert @@ -1,6 +1,6 @@ - @@ -90,10 +90,10 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later - + - + @@ -171,9 +171,6 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later - - - @@ -183,8 +180,8 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later - - + + @@ -226,9 +223,9 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later - - - + + + @@ -275,11 +272,11 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later - - + + - + @@ -306,7 +303,7 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later - + diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road/errors.netconvert b/tests/netconvert/import/OSM/sidewalks/divided_road/errors.netconvert index c3b9348be129..e69de29bb2d1 100644 --- a/tests/netconvert/import/OSM/sidewalks/divided_road/errors.netconvert +++ b/tests/netconvert/import/OSM/sidewalks/divided_road/errors.netconvert @@ -1 +0,0 @@ -Warning: Shape for junction '1877290319' has distance 44.76 to its given position. diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road/net.netconvert b/tests/netconvert/import/OSM/sidewalks/divided_road/net.netconvert index f03fcb294259..6d6e4c9c1901 100644 --- a/tests/netconvert/import/OSM/sidewalks/divided_road/net.netconvert +++ b/tests/netconvert/import/OSM/sidewalks/divided_road/net.netconvert @@ -1,6 +1,6 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/options.netconvert b/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/options.netconvert new file mode 100644 index 000000000000..7207e4afd993 --- /dev/null +++ b/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/options.netconvert @@ -0,0 +1 @@ +-c osm.netccfg --osm.oneway-reverse-sidewalk diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/osm.netccfg b/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/osm.netccfg new file mode 100644 index 000000000000..bf1f4cb0fd48 --- /dev/null +++ b/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/osm.netccfg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/osm.xml b/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/osm.xml new file mode 100644 index 000000000000..59291465cc66 --- /dev/null +++ b/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/osm.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/output.netconvert b/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/output.netconvert new file mode 100644 index 000000000000..a9d787cc55cb --- /dev/null +++ b/tests/netconvert/import/OSM/sidewalks/divided_road_reverseSidewalk/output.netconvert @@ -0,0 +1 @@ +Success. diff --git a/tests/netconvert/import/OSM/sidewalks/testsuite.netconvert b/tests/netconvert/import/OSM/sidewalks/testsuite.netconvert index e17786e27f62..0d4bc68ecf3f 100644 --- a/tests/netconvert/import/OSM/sidewalks/testsuite.netconvert +++ b/tests/netconvert/import/OSM/sidewalks/testsuite.netconvert @@ -6,3 +6,6 @@ opposite # divided roads should not get sidewalks within divided_road + +# divided roads should not get sidewalks within (unless option overrides) +divided_road_reverseSidewalk diff --git a/tests/netconvert/import/OSM/tostmannplatz/errors.netconvert b/tests/netconvert/import/OSM/tostmannplatz/errors.netconvert index 156d1ddbd89a..b8648ff79245 100644 --- a/tests/netconvert/import/OSM/tostmannplatz/errors.netconvert +++ b/tests/netconvert/import/OSM/tostmannplatz/errors.netconvert @@ -5,6 +5,3 @@ Warning: PT stop '30323970' has been moved to edge '-4752567#2'. Warning: Removing pt stop '2314028901' on non existing edge ''. Warning: Removed 1 pt stops because they could not be assigned to the network Warning: Not joining junctions 2663214240,4002570893 (only 1 exit node). -Warning: Ambiguity in turnarounds computation at junction 'cluster_2663214238_273542034_273542611_3445436408_#4more'. -Warning: Ambiguity in turnarounds computation at junction 'cluster_273542494_3445436416_3445436418_5458979046_#4more'. -Warning: Ambiguity in turnarounds computation at junction 'cluster_31130912_8943896893'. diff --git a/tests/netconvert/import/OSM/tostmannplatz/net.netconvert b/tests/netconvert/import/OSM/tostmannplatz/net.netconvert index c6714a917a6d..b5286a51506e 100644 --- a/tests/netconvert/import/OSM/tostmannplatz/net.netconvert +++ b/tests/netconvert/import/OSM/tostmannplatz/net.netconvert @@ -1,6 +1,6 @@ - @@ -870,6 +870,9 @@ + + + diff --git a/tests/netconvert/meta/write_template_full/cfg.netconvert b/tests/netconvert/meta/write_template_full/cfg.netconvert index 51295114caa6..de7d2a530ec7 100644 --- a/tests/netconvert/meta/write_template_full/cfg.netconvert +++ b/tests/netconvert/meta/write_template_full/cfg.netconvert @@ -1,6 +1,6 @@ - @@ -322,6 +322,7 @@ + From 6b66905bd150dfa99026ea460cdc7ba56f3295f0 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 14:42:58 +0100 Subject: [PATCH 099/116] modified input to test #16060, #21 --- .../input_plain.edg.xml | 2 +- .../guess.from-permissions/net.netconvert | 132 +++++++++--------- 2 files changed, 65 insertions(+), 69 deletions(-) diff --git a/tests/netconvert/function/sidewalks/guess.from-permissions/input_plain.edg.xml b/tests/netconvert/function/sidewalks/guess.from-permissions/input_plain.edg.xml index a6167ef791ba..76f586880f25 100644 --- a/tests/netconvert/function/sidewalks/guess.from-permissions/input_plain.edg.xml +++ b/tests/netconvert/function/sidewalks/guess.from-permissions/input_plain.edg.xml @@ -32,6 +32,6 @@ SPDX-License-Identifier: EPL-2.0 - + diff --git a/tests/netconvert/function/sidewalks/guess.from-permissions/net.netconvert b/tests/netconvert/function/sidewalks/guess.from-permissions/net.netconvert index 289c2e303ec1..5e7c3cac867b 100644 --- a/tests/netconvert/function/sidewalks/guess.from-permissions/net.netconvert +++ b/tests/netconvert/function/sidewalks/guess.from-permissions/net.netconvert @@ -1,6 +1,6 @@ - @@ -43,117 +43,113 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later - - + + - - + + - + - - + + - - + + - - - - + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - - - + + - - - + + + - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + - + + - - + + - - - - - - + + + + + - - - - - - + + + + + + From 5657f47ae9fd5d0ecc1b1032aa9b9633c0c764e6 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 14:53:04 +0100 Subject: [PATCH 100/116] fix #16060 --- src/netbuild/NBEdgeCont.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/netbuild/NBEdgeCont.cpp b/src/netbuild/NBEdgeCont.cpp index 7ccf004aaaaa..bc50a739c607 100644 --- a/src/netbuild/NBEdgeCont.cpp +++ b/src/netbuild/NBEdgeCont.cpp @@ -1699,8 +1699,10 @@ NBEdgeCont::guessSpecialLanes(SUMOVehicleClass svc, double width, double minSpee NBEdge* edge = it->second; if (// not excluded exclude.count(edge->getID()) == 0 - // does not yet have a sidewalk + // does not yet have a sidewalk/bikelane && !edge->hasRestrictedLane(svc) + // needs a sidewalk/bikelane + && ((edge->getPermissions() & ~SVC_VULNERABLE) != 0 || (edge->getPermissions() & svc) == 0) && ( // guess.from-permissions (fromPermissions && (edge->getPermissions() & svc) != 0) From 20e2d7065473948633161088c4f8ddeb9f94722b Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 14:53:11 +0100 Subject: [PATCH 101/116] patching expected results refs #21, #16060 --- .../sidewalks/guess.from-permissions/net.netconvert | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/netconvert/function/sidewalks/guess.from-permissions/net.netconvert b/tests/netconvert/function/sidewalks/guess.from-permissions/net.netconvert index 5e7c3cac867b..7d57af52d2af 100644 --- a/tests/netconvert/function/sidewalks/guess.from-permissions/net.netconvert +++ b/tests/netconvert/function/sidewalks/guess.from-permissions/net.netconvert @@ -1,6 +1,6 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/netconvert/import/OSM/bugs/ticket16061/options.netconvert b/tests/netconvert/import/OSM/bugs/ticket16061/options.netconvert new file mode 100644 index 000000000000..1c042e8a7ade --- /dev/null +++ b/tests/netconvert/import/OSM/bugs/ticket16061/options.netconvert @@ -0,0 +1 @@ +--osm-files osm.xml diff --git a/tests/netconvert/import/OSM/bugs/ticket16061/osm.xml b/tests/netconvert/import/OSM/bugs/ticket16061/osm.xml new file mode 100644 index 000000000000..c681dec99af9 --- /dev/null +++ b/tests/netconvert/import/OSM/bugs/ticket16061/osm.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/netconvert/import/OSM/bugs/ticket16061/output.netconvert b/tests/netconvert/import/OSM/bugs/ticket16061/output.netconvert new file mode 100644 index 000000000000..a9d787cc55cb --- /dev/null +++ b/tests/netconvert/import/OSM/bugs/ticket16061/output.netconvert @@ -0,0 +1 @@ +Success. From 65e453b05ab577b1d19159e34439a7b1ede71fc0 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 15:35:30 +0100 Subject: [PATCH 103/116] fix #16061 --- src/netimport/NIImporter_OpenStreetMap.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/netimport/NIImporter_OpenStreetMap.cpp b/src/netimport/NIImporter_OpenStreetMap.cpp index 1ffb27a499e2..b5a292496000 100644 --- a/src/netimport/NIImporter_OpenStreetMap.cpp +++ b/src/netimport/NIImporter_OpenStreetMap.cpp @@ -665,9 +665,15 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t // the total number of lanes is not known but at least one direction if (e->myNoLanesForward > 0) { numLanesForward = e->myNoLanesForward; + } else if ((e->myBuswayType & WAY_FORWARD) != 0 && (extraDis & SVC_PASSENGER) == 0) { + // if we have a busway lane, yet cars may drive this implies at least two lanes + numLanesForward = MAX2(numLanesForward, 2); } if (e->myNoLanesForward < 0) { numLanesBackward = -e->myNoLanesForward; + } else if ((e->myBuswayType & WAY_BACKWARD) != 0 && (extraDis & SVC_PASSENGER) == 0) { + // if we have a busway lane, yet cars may drive this implies at least two lanes + numLanesBackward = MAX2(numLanesForward, 2); } } // deal with busways that run in the opposite direction of a one-way street From 2ba39f5b91435f23082130df0cb87bd77949f4e8 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 15:35:41 +0100 Subject: [PATCH 104/116] patching expected results refs #21, #16061 --- .../OSM/bugs/ticket16061/net.netconvert | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/tests/netconvert/import/OSM/bugs/ticket16061/net.netconvert b/tests/netconvert/import/OSM/bugs/ticket16061/net.netconvert index 884b1b00d737..77bf3b3a5d22 100644 --- a/tests/netconvert/import/OSM/bugs/ticket16061/net.netconvert +++ b/tests/netconvert/import/OSM/bugs/ticket16061/net.netconvert @@ -1,6 +1,6 @@ - + + + + + + diff --git a/tests/tools/output/edgeDepartDelay/errors.tools b/tests/tools/output/edgeDepartDelay/errors.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/output/edgeDepartDelay/options.tools b/tests/tools/output/edgeDepartDelay/options.tools new file mode 100644 index 000000000000..e8440bce4748 --- /dev/null +++ b/tests/tools/output/edgeDepartDelay/options.tools @@ -0,0 +1 @@ +-t tripinfos.xml -o edgedata.xml tools/output/edgeDepartDelay.py diff --git a/tests/tools/output/edgeDepartDelay/output.tools b/tests/tools/output/edgeDepartDelay/output.tools new file mode 100644 index 000000000000..6d57062e2e1b --- /dev/null +++ b/tests/tools/output/edgeDepartDelay/output.tools @@ -0,0 +1,5 @@ +departure: count 4, min 0.00 (0), max 0.00 (0), mean 0.00, Q1 0.00, median 0.00, Q3 0.00 +departDelay: count 4, min 0.00 (0), max 3.00 (1), mean 0.75, Q1 0.00, median 0.00, Q3 3.00 +edgeDelay-max: count 1, min 3.00 (4/1to3/1), max 3.00 (4/1to3/1), mean 3.00, Q1 3.00, median 3.00, Q3 3.00 +edgeDelay-avg: count 1, min 0.75 (4/1to3/1), max 0.75 (4/1to3/1), mean 0.75, Q1 0.75, median 0.75, Q3 0.75 +edgeDelay-total: count 1, min 3.00 (4/1to3/1), max 3.00 (4/1to3/1), mean 3.00, Q1 3.00, median 3.00, Q3 3.00 diff --git a/tests/tools/output/edgeDepartDelay/tripinfos.xml b/tests/tools/output/edgeDepartDelay/tripinfos.xml new file mode 100644 index 000000000000..4e6dc6a38da9 --- /dev/null +++ b/tests/tools/output/edgeDepartDelay/tripinfos.xml @@ -0,0 +1,39 @@ + + + + + + + + + + diff --git a/tests/tools/output/testsuite.tools b/tests/tools/output/testsuite.tools index 26baa205270e..c6791b2f39e7 100644 --- a/tests/tools/output/testsuite.tools +++ b/tests/tools/output/testsuite.tools @@ -20,6 +20,7 @@ tripinfoDiff # difference of tripinfo output with personInfo elements tripinfoDiff_persons +edgeDepartDelay tripinfoByType tripinfoByTAZ attributeStats From 2659364b1ef8cc10fcad997802ada2341f70cd8d Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 15:54:58 +0100 Subject: [PATCH 106/116] #2 another release step --- docs/web/docs/Developer/HowToRelease.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/web/docs/Developer/HowToRelease.md b/docs/web/docs/Developer/HowToRelease.md index ad1a87a9e6ae..3d78405603d0 100644 --- a/docs/web/docs/Developer/HowToRelease.md +++ b/docs/web/docs/Developer/HowToRelease.md @@ -51,6 +51,7 @@ software (Veins, VSimRTI, flow etc.) at this stage. - update the [ChangeLog](../ChangeLog.md) - generate options documentation and xsd schemata for configuration files using `tools/build_config/rebuildConfigDocsAndXsd.py` +- update `tools/build_config/templates.py` to include any tools that were added or had their compatibility fixed since the last release - check the internal tests (same procedure as above), especially the (to be) published scenarios - GitHub From 27030dc942fdbc003fd86502b3f0c2aac31732a8 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 16:00:55 +0100 Subject: [PATCH 107/116] #2 doc #16021 --- docs/web/docs/Tools/Output.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/web/docs/Tools/Output.md b/docs/web/docs/Tools/Output.md index aeafdc2f60cf..05bd02e1de62 100644 --- a/docs/web/docs/Tools/Output.md +++ b/docs/web/docs/Tools/Output.md @@ -384,3 +384,18 @@ python tools/output/fcdDiff fcd.xml fcd2.xml - If option **--grouped** is set, separate statistics for each vehicle will be printed - If option **--tripId** is set, vehicles will be matched by attribute `tripId` instead of `id` (requires **--fcd-output.params tripId** to be when generating the fcd-output) - With option **--xml-output** {{DT_FILE}}, An annotated fcd file with error values is written + +## edgeDepartDelay.py + +Compute departDelay per edge from tripinfo-output + +``` +python tools/output/edgeDepartDelay -t tripinfos.xml -o edgedata.xml +``` + +Attributes for each edge will be statistical measures: + + + +The *maxLabel* attribute will hold the id of the vehicle with the maximum departDelay on a given edge. + From c3c01b486a9750108a3fceb91e7837222f683625 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 16:06:47 +0100 Subject: [PATCH 108/116] added tests refs #21, #16028 --- tests/tools/route/geoTrip2POI/errors.tools | 0 .../route/geoTrip2POI/input_trips.trips.xml | 39 +++++++++++++++++++ tests/tools/route/geoTrip2POI/options.tools | 1 + tests/tools/route/geoTrip2POI/output.tools | 0 tests/tools/route/geoTrip2POI/pois.tools | 15 +++++++ tests/tools/route/testsuite.tools | 1 + 6 files changed, 56 insertions(+) create mode 100644 tests/tools/route/geoTrip2POI/errors.tools create mode 100644 tests/tools/route/geoTrip2POI/input_trips.trips.xml create mode 100644 tests/tools/route/geoTrip2POI/options.tools create mode 100644 tests/tools/route/geoTrip2POI/output.tools create mode 100644 tests/tools/route/geoTrip2POI/pois.tools diff --git a/tests/tools/route/geoTrip2POI/errors.tools b/tests/tools/route/geoTrip2POI/errors.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/route/geoTrip2POI/input_trips.trips.xml b/tests/tools/route/geoTrip2POI/input_trips.trips.xml new file mode 100644 index 000000000000..6b1ce326bf73 --- /dev/null +++ b/tests/tools/route/geoTrip2POI/input_trips.trips.xml @@ -0,0 +1,39 @@ + + + + + + + + + + diff --git a/tests/tools/route/geoTrip2POI/options.tools b/tests/tools/route/geoTrip2POI/options.tools new file mode 100644 index 000000000000..a2cf1d24d52d --- /dev/null +++ b/tests/tools/route/geoTrip2POI/options.tools @@ -0,0 +1 @@ +input_trips.trips.xml -o pois.add.xml tools/route/geoTrip2POI.py diff --git a/tests/tools/route/geoTrip2POI/output.tools b/tests/tools/route/geoTrip2POI/output.tools new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/tools/route/geoTrip2POI/pois.tools b/tests/tools/route/geoTrip2POI/pois.tools new file mode 100644 index 000000000000..04b90898acf4 --- /dev/null +++ b/tests/tools/route/geoTrip2POI/pois.tools @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/tests/tools/route/testsuite.tools b/tests/tools/route/testsuite.tools index bedef4cb03d1..a861aa1e3700 100644 --- a/tests/tools/route/testsuite.tools +++ b/tests/tools/route/testsuite.tools @@ -18,6 +18,7 @@ route2sel # Tests for /tools/route_tools/route_1htoDay.py route_1htoDay +geoTrip2POI # sort routes and flows sort From c60b30b3bd9df40fde7075d40c5fb07041fe0d35 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Thu, 23 Jan 2025 16:09:27 +0100 Subject: [PATCH 109/116] #2 doc #16028 --- docs/web/docs/Tools/Routes.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/web/docs/Tools/Routes.md b/docs/web/docs/Tools/Routes.md index a6ae16687b73..e08696441b24 100644 --- a/docs/web/docs/Tools/Routes.md +++ b/docs/web/docs/Tools/Routes.md @@ -533,3 +533,13 @@ python tools/route/route2OD.py -r -a -o Not only route file but also trip file can be used as input. The tool will firstly try to find the start edge and the end edge of each trip or flows and match them to the respective origin and destination TAZ according to the input taz-file. The counts of the TAZ-relations will be calculated and saved. If only TAZ-information in the given trip or route file is available, this tool will directly calculate TAZ-based OD relation counts without using the information in the given taz-file, which connection edges locate in each TAZ. If the option **--edge-relations** is set, edge-based relation counts will be calculated and saved, only when start/end edge information is available. When option **--interval TIME** (short **-i**) is set, the OD-Matrix will be split into time slices of the given duration. + +# geoTrip2POI.py + +Load a file with trips define with fromLonLat / toLonLat and convert it to a poi file +Departure pois will be red and arrival pois will be blue and their visual size reflects the number of departs/arrivals at that location. + +``` +python tools/route/geoTrip2POI.py -o +``` + From 0fb1e3a8be04fd82ce9f0ed2ec068c13fcf79c22 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Thu, 23 Jan 2025 11:54:42 +0100 Subject: [PATCH 110/116] Updated creation of embedded routes to avoid invalid errors during loading demand elements. Refs #16027 --- .../elements/demand/GNERouteHandler.cpp | 188 ++++++++++-------- src/netedit/elements/demand/GNERouteHandler.h | 15 +- src/utils/handlers/CommonHandler.cpp | 20 ++ src/utils/handlers/CommonHandler.h | 9 +- src/utils/handlers/RouteHandler.cpp | 164 +++++++++------ src/utils/handlers/RouteHandler.h | 36 +++- 6 files changed, 274 insertions(+), 158 deletions(-) diff --git a/src/netedit/elements/demand/GNERouteHandler.cpp b/src/netedit/elements/demand/GNERouteHandler.cpp index 3adeb200e794..69cacf7fa8e1 100644 --- a/src/netedit/elements/demand/GNERouteHandler.cpp +++ b/src/netedit/elements/demand/GNERouteHandler.cpp @@ -189,7 +189,7 @@ GNERouteHandler::buildRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseOb // parse edges const auto edges = parseEdges(SUMO_TAG_ROUTE, id, edgeIDs); if (edges.empty()) { - return false; + return writeErrorEmptyEdges(SUMO_TAG_ROUTE, id); } else { // create GNERoute GNEDemandElement* route = new GNERoute(myNet, id, vClass, edges, color, repeat, cycleTime, routeParameters); @@ -221,62 +221,6 @@ GNERouteHandler::buildRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseOb } -bool -GNERouteHandler::buildEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::vector& edgeIDs, - const RGBColor& color, const int repeat, const SUMOTime cycleTime, const Parameterised::Map& routeParameters) { - // first create vehicle/flow - const SUMOVehicleParameter& vehicleParameters = sumoBaseObject->getParentSumoBaseObject()->getVehicleParameter(); - const SumoXMLTag vehicleTag = (sumoBaseObject->getParentSumoBaseObject()->getTag() == SUMO_TAG_VEHICLE) ? GNE_TAG_VEHICLE_WITHROUTE : - (sumoBaseObject->getParentSumoBaseObject()->getTag() == SUMO_TAG_FLOW) ? GNE_TAG_FLOW_WITHROUTE : - sumoBaseObject->getParentSumoBaseObject()->getTag(); - - // check if ID is duplicated - if (!checkValidDemandElementID(vehicleTag, vehicleParameters.id)) { - return false; - } else if (!checkDuplicatedDemandElement(vehicleTag, myVehicleTags, vehicleParameters.id)) { - return false; - } else { - // parse route edges - const auto edges = parseEdges(SUMO_TAG_ROUTE, vehicleParameters.id, edgeIDs); - if (edges.empty()) { - return false; - } else { - // obtain type - GNEDemandElement* type = getType(vehicleParameters.vtypeid); - if (type == nullptr) { - return writeErrorInvalidParent(vehicleTag, vehicleParameters.id, SUMO_TAG_VTYPE, vehicleParameters.vtypeid); - } else if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DepartLaneDefinition::GIVEN) && ((int)edges.front()->getLanes().size() < vehicleParameters.departLane)) { - return writeError(TLF("Invalid % used in % '%'. % is greater than number of lanes", toString(SUMO_ATTR_DEPARTLANE), toString(vehicleParameters.tag), vehicleParameters.id, toString(vehicleParameters.departLane))); - } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DepartSpeedDefinition::GIVEN) && (type->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { - return writeError(TLF("Invalid % used in % '%'. % is greater than type %", toString(SUMO_ATTR_DEPARTSPEED), toString(vehicleParameters.tag), vehicleParameters.id, toString(vehicleParameters.departSpeed), toString(SUMO_ATTR_MAXSPEED))); - } else { - // create vehicle using vehicleParameters - GNEDemandElement* vehicle = new GNEVehicle(vehicleTag, myNet, type, vehicleParameters); - // create embedded route - GNEDemandElement* route = new GNERoute(myNet, vehicle, edges, color, repeat, cycleTime, routeParameters); - if (myAllowUndoRedo) { - myNet->getViewNet()->getUndoList()->begin(route, TL("add ") + route->getTagStr() + " in '" + vehicle->getID() + "'"); - myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vehicle, true), true); - myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(route, true), true); - myNet->getViewNet()->getUndoList()->end(); - } else { - myNet->getAttributeCarriers()->insertDemandElement(vehicle); - myNet->getAttributeCarriers()->insertDemandElement(route); - type->addChildElement(vehicle); - vehicle->addChildElement(route); - for (const auto& edge : edges) { - edge->addChildElement(route); - } - vehicle->incRef("buildEmbeddedRoute"); - route->incRef("buildEmbeddedRoute"); - } - return true; - } - } - } -} - - bool GNERouteHandler::buildRouteDistribution(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::vector& routeIDs, const std::vector& probabilities) { @@ -352,6 +296,57 @@ GNERouteHandler::buildVehicleOverRoute(const CommonXMLStructure::SumoBaseObject* } +bool +GNERouteHandler::buildVehicleEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, + const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, + const double probability, const Parameterised::Map& routeParameters) { + // check if ID is duplicated + if (!checkValidDemandElementID(GNE_TAG_VEHICLE_WITHROUTE, vehicleParameters.id)) { + return false; + } else if (!checkDuplicatedDemandElement(GNE_TAG_VEHICLE_WITHROUTE, myVehicleTags, vehicleParameters.id)) { + return false; + } else { + // parse route edges + const auto edges = parseEdges(GNE_TAG_ROUTE_EMBEDDED, vehicleParameters.id, edgeIDs); + if (edges.empty()) { + return writeErrorEmptyEdges(GNE_TAG_ROUTE_EMBEDDED, vehicleParameters.id); + } else { + // obtain type + GNEDemandElement* type = getType(vehicleParameters.vtypeid); + if (type == nullptr) { + return writeErrorInvalidParent(GNE_TAG_VEHICLE_WITHROUTE, vehicleParameters.id, SUMO_TAG_VTYPE, vehicleParameters.vtypeid); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DepartLaneDefinition::GIVEN) && ((int)edges.front()->getLanes().size() < vehicleParameters.departLane)) { + return writeError(TLF("Invalid % used in % '%'. % is greater than number of lanes", toString(SUMO_ATTR_DEPARTLANE), toString(vehicleParameters.tag), vehicleParameters.id, toString(vehicleParameters.departLane))); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DepartSpeedDefinition::GIVEN) && (type->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { + return writeError(TLF("Invalid % used in % '%'. % is greater than type %", toString(SUMO_ATTR_DEPARTSPEED), toString(vehicleParameters.tag), vehicleParameters.id, toString(vehicleParameters.departSpeed), toString(SUMO_ATTR_MAXSPEED))); + } else { + // create vehicle using vehicleParameters + GNEDemandElement* vehicle = new GNEVehicle(GNE_TAG_VEHICLE_WITHROUTE, myNet, type, vehicleParameters); + // create embedded route + GNEDemandElement* route = new GNERoute(myNet, vehicle, edges, color, repeat, cycleTime, routeParameters); + if (myAllowUndoRedo) { + myNet->getViewNet()->getUndoList()->begin(vehicle, TL("add ") + vehicle->getTagStr() + " '" + vehicleParameters.id + "'"); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vehicle, true), true); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(route, true), true); + myNet->getViewNet()->getUndoList()->end(); + } else { + myNet->getAttributeCarriers()->insertDemandElement(vehicle); + myNet->getAttributeCarriers()->insertDemandElement(route); + type->addChildElement(vehicle); + vehicle->addChildElement(route); + for (const auto& edge : edges) { + edge->addChildElement(route); + } + vehicle->incRef("buildVehicleEmbeddedRoute"); + route->incRef("buildVehicleEmbeddedRoute"); + } + return true; + } + } + } +} + + bool GNERouteHandler::buildFlowOverRoute(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters) { // first check if ID is duplicated @@ -391,6 +386,57 @@ GNERouteHandler::buildFlowOverRoute(const CommonXMLStructure::SumoBaseObject* /* } +bool +GNERouteHandler::buildFlowEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, + const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, + const double probability, const Parameterised::Map& routeParameters) { + // check if ID is duplicated + if (!checkValidDemandElementID(GNE_TAG_FLOW_WITHROUTE, vehicleParameters.id)) { + return false; + } else if (!checkDuplicatedDemandElement(GNE_TAG_FLOW_WITHROUTE, myVehicleTags, vehicleParameters.id)) { + return false; + } else { + // parse route edges + const auto edges = parseEdges(GNE_TAG_ROUTE_EMBEDDED, vehicleParameters.id, edgeIDs); + if (edges.empty()) { + return writeErrorEmptyEdges(GNE_TAG_ROUTE_EMBEDDED, vehicleParameters.id); + } else { + // obtain type + GNEDemandElement* type = getType(vehicleParameters.vtypeid); + if (type == nullptr) { + return writeErrorInvalidParent(GNE_TAG_FLOW_WITHROUTE, vehicleParameters.id, SUMO_TAG_VTYPE, vehicleParameters.vtypeid); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DepartLaneDefinition::GIVEN) && ((int)edges.front()->getLanes().size() < vehicleParameters.departLane)) { + return writeError(TLF("Invalid % used in % '%'. % is greater than number of lanes", toString(SUMO_ATTR_DEPARTLANE), toString(vehicleParameters.tag), vehicleParameters.id, toString(vehicleParameters.departLane))); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DepartSpeedDefinition::GIVEN) && (type->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { + return writeError(TLF("Invalid % used in % '%'. % is greater than type %", toString(SUMO_ATTR_DEPARTSPEED), toString(vehicleParameters.tag), vehicleParameters.id, toString(vehicleParameters.departSpeed), toString(SUMO_ATTR_MAXSPEED))); + } else { + // create vehicle using vehicleParameters + GNEDemandElement* vehicle = new GNEVehicle(GNE_TAG_FLOW_WITHROUTE, myNet, type, vehicleParameters); + // create embedded route + GNEDemandElement* route = new GNERoute(myNet, vehicle, edges, color, repeat, cycleTime, routeParameters); + if (myAllowUndoRedo) { + myNet->getViewNet()->getUndoList()->begin(vehicle, TL("add ") + vehicle->getTagStr() + " '" + vehicleParameters.id + "'"); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vehicle, true), true); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(route, true), true); + myNet->getViewNet()->getUndoList()->end(); + } else { + myNet->getAttributeCarriers()->insertDemandElement(vehicle); + myNet->getAttributeCarriers()->insertDemandElement(route); + type->addChildElement(vehicle); + vehicle->addChildElement(route); + for (const auto& edge : edges) { + edge->addChildElement(route); + } + vehicle->incRef("buildFlowEmbeddedRoute"); + route->incRef("buildFlowEmbeddedRoute"); + } + return true; + } + } + } +} + + bool GNERouteHandler::buildTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, const std::string& fromEdgeID, const std::string& toEdgeID) { @@ -1605,24 +1651,15 @@ GNERouteHandler::transformToVehicle(GNEVehicle* originalVehicle, bool createEmbe if (createEmbeddedRoute) { // change tag in vehicle parameters vehicleParameters.tag = GNE_TAG_VEHICLE_WITHROUTE; - // create a flow with embebbed routes - CommonXMLStructure::SumoBaseObject* vehicleBaseOBject = new CommonXMLStructure::SumoBaseObject(nullptr); - CommonXMLStructure::SumoBaseObject* routeBaseOBject = new CommonXMLStructure::SumoBaseObject(vehicleBaseOBject); - // fill parameters - vehicleBaseOBject->setTag(SUMO_TAG_VEHICLE); - vehicleBaseOBject->addStringAttribute(SUMO_ATTR_ID, vehicleParameters.id); - vehicleBaseOBject->setVehicleParameter(&vehicleParameters); // build embedded route - routeHandler.buildEmbeddedRoute(routeBaseOBject, edgeIDs, RGBColor::INVISIBLE, false, 0, {}); - // delete vehicle base object - delete vehicleBaseOBject; + routeHandler.buildVehicleEmbeddedRoute(nullptr, vehicleParameters, edgeIDs, RGBColor::INVISIBLE, 0, 0, 0, {}); } else { // change tag in vehicle parameters vehicleParameters.tag = SUMO_TAG_VEHICLE; // generate route ID const std::string routeID = net->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_ROUTE); // build route - routeHandler.buildRoute(nullptr, routeID, vClass, edgeIDs, routeColor, false, 0, 1.0, {}); + routeHandler.buildRoute(nullptr, routeID, vClass, edgeIDs, routeColor, false, 0, 0, {}); // set route ID in vehicle parameters vehicleParameters.routeid = routeID; // create vehicle @@ -1708,24 +1745,15 @@ GNERouteHandler::transformToRouteFlow(GNEVehicle* originalVehicle, bool createEm if (createEmbeddedRoute) { // change tag in vehicle parameters vehicleParameters.tag = GNE_TAG_FLOW_WITHROUTE; - // create a flow with embebbed routes - CommonXMLStructure::SumoBaseObject* vehicleBaseOBject = new CommonXMLStructure::SumoBaseObject(nullptr); - CommonXMLStructure::SumoBaseObject* routeBaseOBject = new CommonXMLStructure::SumoBaseObject(vehicleBaseOBject); - // fill parameters - vehicleBaseOBject->setTag(SUMO_TAG_FLOW); - vehicleBaseOBject->addStringAttribute(SUMO_ATTR_ID, vehicleParameters.id); - vehicleBaseOBject->setVehicleParameter(&vehicleParameters); // build embedded route - routeHandler.buildEmbeddedRoute(routeBaseOBject, edgeIDs, RGBColor::INVISIBLE, false, 0, {}); - // delete vehicle base object - delete vehicleBaseOBject; + routeHandler.buildFlowEmbeddedRoute(nullptr, vehicleParameters, edgeIDs, RGBColor::INVISIBLE, 0, 0, 0, {}); } else { // change tag in vehicle parameters - vehicleParameters.tag = GNE_TAG_FLOW_ROUTE; + vehicleParameters.tag = SUMO_TAG_FLOW; // generate a new route id const std::string routeID = net->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_ROUTE); // build route - routeHandler.buildRoute(nullptr, routeID, vClass, edgeIDs, routeColor, false, 0, 1.0, {}); + routeHandler.buildRoute(nullptr, routeID, vClass, edgeIDs, routeColor, false, 0, 0, {}); // set route ID in vehicle parameters vehicleParameters.routeid = routeID; // create vehicle diff --git a/src/netedit/elements/demand/GNERouteHandler.h b/src/netedit/elements/demand/GNERouteHandler.h index c04d1c6942d7..1a69ab54e09e 100644 --- a/src/netedit/elements/demand/GNERouteHandler.h +++ b/src/netedit/elements/demand/GNERouteHandler.h @@ -79,11 +79,6 @@ class GNERouteHandler : public RouteHandler { const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, const double probability, const Parameterised::Map& routeParameters); - /// @brief build embedded route - bool buildEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::vector& edgeIDs, - const RGBColor& color, const int repeat, const SUMOTime cycleTime, - const Parameterised::Map& routeParameters); - /// @brief build route distribution bool buildRouteDistribution(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::vector& routeIDs, const std::vector& probabilities); @@ -91,9 +86,19 @@ class GNERouteHandler : public RouteHandler { /// @brief build a vehicle over an existent route bool buildVehicleOverRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters); + /// @brief build a vehicle with an embedded route + bool buildVehicleEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, + const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, + const double probability, const Parameterised::Map& routeParameters); + /// @brief build a flow over an existent route bool buildFlowOverRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters); + /// @brief build a flow with an embedded route + bool buildFlowEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, + const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, + const double probability, const Parameterised::Map& routeParameters); + /// @brief build trip bool buildTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, const std::string& fromEdgeID, const std::string& toEdgeID); diff --git a/src/utils/handlers/CommonHandler.cpp b/src/utils/handlers/CommonHandler.cpp index ec8f397d41c2..d3bb33fd729a 100644 --- a/src/utils/handlers/CommonHandler.cpp +++ b/src/utils/handlers/CommonHandler.cpp @@ -117,6 +117,20 @@ CommonHandler::checkListOfVehicleTypes(const SumoXMLTag tag, const std::string& } +bool +CommonHandler::checkDistribution(CommonXMLStructure::SumoBaseObject* obj) { + if (obj->getParentSumoBaseObject() == nullptr) { + return false; + } else if (obj->getParentSumoBaseObject()->getTag() == SUMO_TAG_ROUTE_DISTRIBUTION) { + return true; + } else if (obj->getParentSumoBaseObject()->getTag() == SUMO_TAG_VTYPE_DISTRIBUTION) { + return true; + } else { + return false; + } +} + + bool CommonHandler::checkVehicleParents(CommonXMLStructure::SumoBaseObject* obj) { if (obj == nullptr) { @@ -268,6 +282,12 @@ CommonHandler::writeErrorDuplicated(const SumoXMLTag tag, const std::string& id, } +bool +CommonHandler::writeErrorEmptyEdges(const SumoXMLTag tag, const std::string& id) { + return writeError(TLF("Could not build % with ID '%' in netedit; List of edges cannot be empty.", toString(tag), id)); +} + + bool CommonHandler::writeErrorInvalidLanes(const SumoXMLTag tag, const std::string& id) { return writeError(TLF("Could not build % with ID '%' in netedit; List of lanes isn't valid.", toString(tag), id)); diff --git a/src/utils/handlers/CommonHandler.h b/src/utils/handlers/CommonHandler.h index c10eb647615a..ee761dad6977 100644 --- a/src/utils/handlers/CommonHandler.h +++ b/src/utils/handlers/CommonHandler.h @@ -58,12 +58,16 @@ class CommonHandler { /// @name check functions /// @{ + /// @brief check parsed parents void checkParsedParent(const SumoXMLTag currentTag, const std::vector& parentTags, bool& ok); /// @brief check list of IDs bool checkListOfVehicleTypes(const SumoXMLTag tag, const std::string& id, const std::vector& vTypeIDs); + /// @brief check if the given object is within a distribution (VType or routes) + bool checkDistribution(CommonXMLStructure::SumoBaseObject* obj); + /// @brief check vehicle parents bool checkVehicleParents(CommonXMLStructure::SumoBaseObject* obj); @@ -99,6 +103,9 @@ class CommonHandler { /// @brief write error "duplicated additional" bool writeErrorDuplicated(const SumoXMLTag tag, const std::string& id, const SumoXMLTag checkedTag); + /// @brief write error "empty edges" + bool writeErrorEmptyEdges(const SumoXMLTag tag, const std::string& id); + /// @brief write error "invalid list of lanes" bool writeErrorInvalidLanes(const SumoXMLTag tag, const std::string& id); @@ -114,8 +121,6 @@ class CommonHandler { /// @brief write error "invalid parent element" without giving IDs bool writeErrorInvalidParent(const SumoXMLTag tag, const SumoXMLTag parentTag); - - private: /// @brief invalidate copy constructor CommonHandler(const CommonHandler& s) = delete; diff --git a/src/utils/handlers/RouteHandler.cpp b/src/utils/handlers/RouteHandler.cpp index 048ee37f0328..2ad5c7689f4a 100644 --- a/src/utils/handlers/RouteHandler.cpp +++ b/src/utils/handlers/RouteHandler.cpp @@ -151,30 +151,9 @@ RouteHandler::endParseAttributes() { if (obj) { // close SUMOBaseOBject myCommonXMLStructure.closeSUMOBaseOBject(); - // get parent tag (if exist) - const auto parentTag = obj->getParentSumoBaseObject() ? obj->getParentSumoBaseObject()->getTag() : SUMO_TAG_NOTHING; switch (obj->getTag()) { - // specia case for route (because can be embedded) case SUMO_TAG_ROUTE: - // only parse non-embedded and without distributionsroutes - if ((obj->getStringAttribute(SUMO_ATTR_ID).size() > 0) && - (parentTag != SUMO_TAG_ROUTE_DISTRIBUTION)) { - // parse route and all their childrens - parseSumoBaseObject(obj); - // delete object (and all of their childrens) - delete obj; - } - break; - // demand elements case SUMO_TAG_VTYPE: - // only parse vTypes without distributions - if (parentTag != SUMO_TAG_VTYPE_DISTRIBUTION) { - // parse vType and all their childrens - parseSumoBaseObject(obj); - // delete object (and all of their childrens) - delete obj; - } - break; case SUMO_TAG_VTYPE_DISTRIBUTION: case SUMO_TAG_ROUTE_DISTRIBUTION: case SUMO_TAG_TRIP: @@ -202,9 +181,12 @@ RouteHandler::parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj) { switch (obj->getTag()) { // vTypes case SUMO_TAG_VTYPE: - if (buildVType(obj, - obj->getVehicleTypeParameter())) { - obj->markAsCreated(); + // avoid create distributions here + if (!checkDistribution(obj)) { + if (buildVType(obj, + obj->getVehicleTypeParameter())) { + obj->markAsCreated(); + } } break; case SUMO_TAG_VTYPE_DISTRIBUTION: @@ -218,16 +200,8 @@ RouteHandler::parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj) { break; // route case SUMO_TAG_ROUTE: - if (obj->getStringAttribute(SUMO_ATTR_ID).empty()) { - if (buildEmbeddedRoute(obj, - obj->getStringListAttribute(SUMO_ATTR_EDGES), - obj->getColorAttribute(SUMO_ATTR_COLOR), - obj->getIntAttribute(SUMO_ATTR_REPEAT), - obj->getTimeAttribute(SUMO_ATTR_CYCLETIME), - obj->getParameters())) { - obj->markAsCreated(); - } - } else { + // embedded routes are created in buildEmbeddedRoute + if (!checkDistribution(obj) && obj->hasStringAttribute(SUMO_ATTR_ID)) { if (buildRoute(obj, obj->getStringAttribute(SUMO_ATTR_ID), obj->getVClass(), @@ -252,8 +226,15 @@ RouteHandler::parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj) { // vehicles case SUMO_TAG_TRIP: if (checkVehicleParents(obj)) { - if (obj->hasStringAttribute(SUMO_ATTR_FROM_JUNCTION) && - obj->hasStringAttribute(SUMO_ATTR_TO_JUNCTION)) { + if (isOverFromToEdges(obj)) { + // build trip with from-to edges + if (buildTrip(obj, + obj->getVehicleParameter(), + obj->hasStringAttribute(SUMO_ATTR_FROM) ? obj->getStringAttribute(SUMO_ATTR_FROM) : "", + obj->hasStringAttribute(SUMO_ATTR_TO) ? obj->getStringAttribute(SUMO_ATTR_TO) : "")) { + obj->markAsCreated(); + } + } else if (isOverFromToJunctions(obj)) { // build trip with from-to junctions if (buildTripJunctions(obj, obj->getVehicleParameter(), @@ -261,8 +242,7 @@ RouteHandler::parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj) { obj->getStringAttribute(SUMO_ATTR_TO_JUNCTION))) { obj->markAsCreated(); } - } else if (obj->hasStringAttribute(SUMO_ATTR_FROM_TAZ) && - obj->hasStringAttribute(SUMO_ATTR_TO_TAZ)) { + } else if (isOverFromToTAZs(obj)) { // build trip with from-to TAZs if (buildTripTAZs(obj, obj->getVehicleParameter(), @@ -270,22 +250,32 @@ RouteHandler::parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj) { obj->getStringAttribute(SUMO_ATTR_TO_TAZ))) { obj->markAsCreated(); } - } else { - // build trip with from-to edges - if (buildTrip(obj, - obj->getVehicleParameter(), - obj->hasStringAttribute(SUMO_ATTR_FROM) ? obj->getStringAttribute(SUMO_ATTR_FROM) : "", - obj->hasStringAttribute(SUMO_ATTR_TO) ? obj->getStringAttribute(SUMO_ATTR_TO) : "")) { - obj->markAsCreated(); - } } } break; case SUMO_TAG_VEHICLE: - if (checkVehicleParents(obj) && obj->hasStringAttribute(SUMO_ATTR_ROUTE)) { - if (buildVehicleOverRoute(obj, - obj->getVehicleParameter())) { - obj->markAsCreated(); + if (checkVehicleParents(obj)) { + if (obj->hasStringAttribute(SUMO_ATTR_ROUTE)) { + // build vehicle over route + if (buildVehicleOverRoute(obj, + obj->getVehicleParameter())) { + obj->markAsCreated(); + } + } else { + const auto embeddedRoute = getEmbeddedRoute(obj); + if (embeddedRoute) { + // build vehicle with embedded route + if (buildVehicleEmbeddedRoute(obj, + obj->getVehicleParameter(), + embeddedRoute->getStringListAttribute(SUMO_ATTR_EDGES), + embeddedRoute->getColorAttribute(SUMO_ATTR_COLOR), + embeddedRoute->getIntAttribute(SUMO_ATTR_REPEAT), + embeddedRoute->getTimeAttribute(SUMO_ATTR_CYCLETIME), + embeddedRoute->getDoubleAttribute(SUMO_ATTR_PROB), + embeddedRoute->getParameters())) { + obj->markAsCreated(); + } + } } } break; @@ -298,8 +288,15 @@ RouteHandler::parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj) { obj->getVehicleParameter())) { obj->markAsCreated(); } - } else if (obj->hasStringAttribute(SUMO_ATTR_FROM_JUNCTION) && - obj->hasStringAttribute(SUMO_ATTR_TO_JUNCTION)) { + } else if (isOverFromToEdges(obj)) { + // build flow with from-to edges + if (buildFlow(obj, + obj->getVehicleParameter(), + obj->getStringAttribute(SUMO_ATTR_FROM), + obj->getStringAttribute(SUMO_ATTR_TO))) { + obj->markAsCreated(); + } + } else if (isOverFromToJunctions(obj)) { // build flow with from-to junctions if (buildFlowJunctions(obj, obj->getVehicleParameter(), @@ -307,8 +304,7 @@ RouteHandler::parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj) { obj->getStringAttribute(SUMO_ATTR_TO_JUNCTION))) { obj->markAsCreated(); } - } else if (obj->hasStringAttribute(SUMO_ATTR_FROM_TAZ) && - obj->hasStringAttribute(SUMO_ATTR_TO_TAZ)) { + } else if (isOverFromToTAZs(obj)) { // build flow with from-to TAZs if (buildFlowTAZs(obj, obj->getVehicleParameter(), @@ -316,14 +312,21 @@ RouteHandler::parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj) { obj->getStringAttribute(SUMO_ATTR_TO_TAZ))) { obj->markAsCreated(); } - } else if ((obj->getSumoBaseObjectChildren().size() == 0) || - (obj->getSumoBaseObjectChildren().front()->getTag() != SUMO_TAG_ROUTE)) { - // build flow with from-to edges - if (buildFlow(obj, - obj->getVehicleParameter(), - obj->hasStringAttribute(SUMO_ATTR_FROM) ? obj->getStringAttribute(SUMO_ATTR_FROM) : "", - obj->hasStringAttribute(SUMO_ATTR_TO) ? obj->getStringAttribute(SUMO_ATTR_TO) : "")) { - obj->markAsCreated(); + + } else { + const auto embeddedRoute = getEmbeddedRoute(obj); + if (embeddedRoute) { + // build flow with embedded route + if (buildFlowEmbeddedRoute(obj, + obj->getVehicleParameter(), + embeddedRoute->getStringListAttribute(SUMO_ATTR_EDGES), + embeddedRoute->getColorAttribute(SUMO_ATTR_COLOR), + embeddedRoute->getIntAttribute(SUMO_ATTR_REPEAT), + embeddedRoute->getTimeAttribute(SUMO_ATTR_CYCLETIME), + embeddedRoute->getDoubleAttribute(SUMO_ATTR_PROB), + embeddedRoute->getParameters())) { + obj->markAsCreated(); + } } } } @@ -480,7 +483,7 @@ RouteHandler::parseRoute(const SUMOSAXAttributes& attrs) { // declare Ok Flag bool parsedOk = true; // special case for ID - const std::string id = attrs.getOpt(SUMO_ATTR_ID, "", parsedOk, ""); + const std::string id = embeddedRoute? myCommonXMLStructure.getCurrentSumoBaseObject()->getParentSumoBaseObject()->getVehicleParameter().id : attrs.get(SUMO_ATTR_ID, "", parsedOk); // needed attributes const std::vector edges = attrs.get >(SUMO_ATTR_EDGES, id.c_str(), parsedOk); // optional attributes @@ -496,8 +499,11 @@ RouteHandler::parseRoute(const SUMOSAXAttributes& attrs) { if (parsedOk) { // set tag myCommonXMLStructure.getCurrentSumoBaseObject()->setTag(SUMO_TAG_ROUTE); + // special case for ID (because empty id means embedded route) + if (!embeddedRoute) { + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_ID, id); + } // add all attributes - myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_ID, id); myCommonXMLStructure.getCurrentSumoBaseObject()->setVClass(vClass); myCommonXMLStructure.getCurrentSumoBaseObject()->addStringListAttribute(SUMO_ATTR_EDGES, edges); myCommonXMLStructure.getCurrentSumoBaseObject()->addColorAttribute(SUMO_ATTR_COLOR, color); @@ -1207,4 +1213,34 @@ RouteHandler::isEmbeddedRoute(const SUMOSAXAttributes& attrs) const { } } + +bool +RouteHandler::isOverFromToEdges(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const { + return sumoBaseObject->hasStringAttribute(SUMO_ATTR_FROM) && sumoBaseObject->hasStringAttribute(SUMO_ATTR_TO); +} + + +bool +RouteHandler::isOverFromToJunctions(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const { + return sumoBaseObject->hasStringAttribute(SUMO_ATTR_FROM_JUNCTION) && sumoBaseObject->hasStringAttribute(SUMO_ATTR_TO_JUNCTION); +} + + +bool +RouteHandler::isOverFromToTAZs(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const { + return sumoBaseObject->hasStringAttribute(SUMO_ATTR_FROM_TAZ) && sumoBaseObject->hasStringAttribute(SUMO_ATTR_TO_TAZ); +} + + +CommonXMLStructure::SumoBaseObject* +RouteHandler::getEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const { + // locate route in childrens + for (const auto &embeddedRoute : sumoBaseObject->getSumoBaseObjectChildren()) { + if ((embeddedRoute->getTag() == SUMO_TAG_ROUTE) && (!embeddedRoute->hasStringAttribute(SUMO_ATTR_ID))) { + return embeddedRoute; + } + } + return nullptr; +} + /****************************************************************************/ diff --git a/src/utils/handlers/RouteHandler.h b/src/utils/handlers/RouteHandler.h index cf3af1d3c753..0160f1660b26 100644 --- a/src/utils/handlers/RouteHandler.h +++ b/src/utils/handlers/RouteHandler.h @@ -65,11 +65,6 @@ class RouteHandler : public CommonHandler { const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, const double probability, const Parameterised::Map& routeParameters) = 0; - /// @brief build embedded route - virtual bool buildEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::vector& edgeIDs, - const RGBColor& color, const int repeat, const SUMOTime cycleTime, - const Parameterised::Map& routeParameters) = 0; - /// @brief build route distribution virtual bool buildRouteDistribution(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::vector& vTypeIDs, const std::vector& probabilities) = 0; @@ -77,9 +72,19 @@ class RouteHandler : public CommonHandler { /// @brief build a vehicle over an existent route virtual bool buildVehicleOverRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters) = 0; + /// @brief build a vehicle with an embedded route + virtual bool buildVehicleEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, + const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, + const double probability, const Parameterised::Map& routeParameters) = 0; + /// @brief build a flow over an existent route virtual bool buildFlowOverRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters) = 0; + /// @brief build a flow with an embedded route + virtual bool buildFlowEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, + const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, + const double probability, const Parameterised::Map& routeParameters) = 0; + /// @brief build trip (from-to edges) virtual bool buildTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, const std::string& fromEdgeID, const std::string& toEdgeID) = 0; @@ -219,10 +224,27 @@ class RouteHandler : public CommonHandler { /// @brief parse stop parameters bool parseStopParameters(SUMOVehicleParameter::Stop& stop, const SUMOSAXAttributes& attrs); + /// @brief check if the current obj is an embedded route + bool isEmbeddedRoute(const SUMOSAXAttributes& attrs) const; + /// @} - /// @brief check embedded route - bool isEmbeddedRoute(const SUMOSAXAttributes& attrs) const; + /// @name check functions used for simplify code in handlers + /// @{ + + /// @brief check if element is defined over from-to edges + bool isOverFromToEdges(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const; + + /// @brief check if element is defined over from-to junctions + bool isOverFromToJunctions(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const; + + /// @brief check if element is defined over from-to junctions + bool isOverFromToTAZs(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const; + + /// @brief get embedded route from children + CommonXMLStructure::SumoBaseObject* getEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const; + + /// @} /// @brief invalidate copy constructor RouteHandler(const RouteHandler& s) = delete; From c779303a30de333a1ee0f385e6343733109539b9 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Thu, 23 Jan 2025 12:54:37 +0100 Subject: [PATCH 111/116] Now routes supports attribute probability. Refs #16027 --- src/netedit/elements/GNEAttributeCarrier.cpp | 6 ++ src/netedit/elements/demand/GNERoute.cpp | 92 +++++++++++-------- src/netedit/elements/demand/GNERoute.h | 9 +- .../elements/demand/GNERouteHandler.cpp | 14 +-- src/utils/handlers/RouteHandler.cpp | 2 +- 5 files changed, 77 insertions(+), 46 deletions(-) diff --git a/src/netedit/elements/GNEAttributeCarrier.cpp b/src/netedit/elements/GNEAttributeCarrier.cpp index db02698e9075..9be29289d7c1 100644 --- a/src/netedit/elements/GNEAttributeCarrier.cpp +++ b/src/netedit/elements/GNEAttributeCarrier.cpp @@ -3753,6 +3753,12 @@ GNEAttributeCarrier::fillDemandElements() { TL("the times will be shifted forward by 'cycleTime' on each repeat"), "0"); myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, + TL("The probability when being added to a distribution without an explicit probability"), + "1.0"); + myTagProperties[currentTag].addAttribute(attrProperty); } currentTag = SUMO_TAG_ROUTE_DISTRIBUTION; { diff --git a/src/netedit/elements/demand/GNERoute.cpp b/src/netedit/elements/demand/GNERoute.cpp index a4b994c4fb18..02df2df9a8e4 100644 --- a/src/netedit/elements/demand/GNERoute.cpp +++ b/src/netedit/elements/demand/GNERoute.cpp @@ -77,12 +77,13 @@ GNERoute::GNERoutePopupMenu::onCmdApplyDistance(FXObject*, FXSelector, void*) { GNERoute::GNERoute(SumoXMLTag tag, GNENet* net) : GNEDemandElement("", net, GLO_ROUTE, tag, GUIIconSubSys::getIcon(GUIIcon::ROUTE), GNEPathElement::Options::DEMAND_ELEMENT | GNEPathElement::Options::ROUTE, -{}, {}, {}, {}, {}, {}), -Parameterised(), -myColor(RGBColor::YELLOW), -myRepeat(0), -myCycleTime(0), -myVClass(SVC_PASSENGER) { + {}, {}, {}, {}, {}, {}), + Parameterised(), + myColor(RGBColor::YELLOW), + myRepeat(0), + myCycleTime(0), + myProbability(1.0), + myVClass(SVC_PASSENGER) { // reset default values resetDefaultValues(); } @@ -92,12 +93,13 @@ GNERoute::GNERoute(GNENet* net) : GNEDemandElement(net->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_ROUTE), net, GLO_ROUTE, SUMO_TAG_ROUTE, GUIIconSubSys::getIcon(GUIIcon::ROUTE), GNEPathElement::Options::DEMAND_ELEMENT | GNEPathElement::Options::ROUTE, -{}, {}, {}, {}, {}, {}), -Parameterised(), -myColor(RGBColor::YELLOW), -myRepeat(0), -myCycleTime(0), -myVClass(SVC_PASSENGER) { + {}, {}, {}, {}, {}, {}), + Parameterised(), + myColor(RGBColor::YELLOW), + myRepeat(0), + myCycleTime(0), + myProbability(1.0), + myVClass(SVC_PASSENGER) { // reset default values resetDefaultValues(); } @@ -106,11 +108,12 @@ myVClass(SVC_PASSENGER) { GNERoute::GNERoute(GNENet* net, const std::string& id, const GNEDemandElement* originalRoute) : GNEDemandElement(id, net, GLO_ROUTE, SUMO_TAG_ROUTE, GUIIconSubSys::getIcon(GUIIcon::ROUTE), GNEPathElement::Options::DEMAND_ELEMENT | GNEPathElement::Options::ROUTE, -{}, originalRoute->getParentEdges(), {}, {}, {}, {}), -Parameterised(originalRoute->getACParametersMap()), -myRepeat(parse(originalRoute->getAttribute(SUMO_ATTR_REPEAT))), -myCycleTime(string2time(originalRoute->getAttribute(SUMO_ATTR_REPEAT))), -myVClass(originalRoute->getVClass()) { + {}, originalRoute->getParentEdges(), {}, {}, {}, {}), + Parameterised(originalRoute->getACParametersMap()), + myRepeat(parse(originalRoute->getAttribute(SUMO_ATTR_REPEAT))), + myCycleTime(string2time(originalRoute->getAttribute(SUMO_ATTR_REPEAT))), + myProbability(parse(originalRoute->getAttribute(SUMO_ATTR_PROB))), + myVClass(originalRoute->getVClass()) { setAttribute(SUMO_ATTR_COLOR, originalRoute->getAttribute(SUMO_ATTR_COLOR)); } @@ -118,38 +121,43 @@ myVClass(originalRoute->getVClass()) { GNERoute::GNERoute(GNENet* net, GNEVehicle* vehicleParent, const GNEDemandElement* originalRoute) : GNEDemandElement(vehicleParent, net, GLO_ROUTE_EMBEDDED, GNE_TAG_ROUTE_EMBEDDED, GUIIconSubSys::getIcon(GUIIcon::ROUTE), GNEPathElement::Options::DEMAND_ELEMENT | GNEPathElement::Options::ROUTE, -{}, originalRoute->getParentEdges(), {}, {}, {vehicleParent}, {}), -Parameterised(originalRoute->getACParametersMap()), -myRepeat(parse(originalRoute->getAttribute(SUMO_ATTR_REPEAT))), -myCycleTime(string2time(originalRoute->getAttribute(SUMO_ATTR_REPEAT))), -myVClass(originalRoute->getVClass()) { + {}, originalRoute->getParentEdges(), {}, {}, {vehicleParent}, {}), + Parameterised(originalRoute->getACParametersMap()), + myRepeat(parse(originalRoute->getAttribute(SUMO_ATTR_REPEAT))), + myCycleTime(string2time(originalRoute->getAttribute(SUMO_ATTR_REPEAT))), + myProbability(parse(originalRoute->getAttribute(SUMO_ATTR_PROB))), + myVClass(originalRoute->getVClass()) { setAttribute(SUMO_ATTR_COLOR, originalRoute->getAttribute(SUMO_ATTR_COLOR)); } GNERoute::GNERoute(GNENet* net, const std::string& id, SUMOVehicleClass vClass, const std::vector& edges, - const RGBColor& color, const int repeat, const SUMOTime cycleTime, const Parameterised::Map& parameters) : + const RGBColor& color, const int repeat, const SUMOTime cycleTime, const double probability, + const Parameterised::Map& parameters) : GNEDemandElement(id, net, GLO_ROUTE, SUMO_TAG_ROUTE, GUIIconSubSys::getIcon(GUIIcon::ROUTE), GNEPathElement::Options::DEMAND_ELEMENT | GNEPathElement::Options::ROUTE, -{}, edges, {}, {}, {}, {}), -Parameterised(parameters), -myColor(color), -myRepeat(repeat), -myCycleTime(cycleTime), -myVClass(vClass) { + {}, edges, {}, {}, {}, {}), + Parameterised(parameters), + myColor(color), + myRepeat(repeat), + myCycleTime(cycleTime), + myProbability(probability), + myVClass(vClass) { } GNERoute::GNERoute(GNENet* net, GNEDemandElement* vehicleParent, const std::vector& edges, - const RGBColor& color, const int repeat, const SUMOTime cycleTime, const Parameterised::Map& parameters) : + const RGBColor& color, const int repeat, const SUMOTime cycleTime, const double probability, + const Parameterised::Map& parameters) : GNEDemandElement(vehicleParent, net, GLO_ROUTE_EMBEDDED, GNE_TAG_ROUTE_EMBEDDED, GUIIconSubSys::getIcon(GUIIcon::ROUTE), GNEPathElement::Options::DEMAND_ELEMENT | GNEPathElement::Options::ROUTE, -{}, edges, {}, {}, {vehicleParent}, {}), -Parameterised(parameters), -myColor(color), -myRepeat(repeat), -myCycleTime(cycleTime), -myVClass(vehicleParent->getVClass()) { + {}, edges, {}, {}, {vehicleParent}, {}), + Parameterised(parameters), + myColor(color), + myRepeat(repeat), + myCycleTime(cycleTime), + myProbability(probability), + myVClass(vehicleParent->getVClass()) { } @@ -212,6 +220,9 @@ GNERoute::writeDemandElement(OutputDevice& device) const { if (myCycleTime != 0) { device.writeAttr(SUMO_ATTR_CYCLETIME, time2string(myCycleTime)); } + if (myProbability != 1) { + device.writeAttr(SUMO_ATTR_PROB, toString(myProbability)); + } // write sorted stops if (myTagProperty.getTag() == SUMO_TAG_ROUTE) { // write stops @@ -536,6 +547,8 @@ GNERoute::getAttribute(SumoXMLAttr key) const { return toString(myRepeat); case SUMO_ATTR_CYCLETIME: return time2string(myCycleTime); + case SUMO_ATTR_PROB: + return toString(myProbability); case GNE_ATTR_PARAMETERS: return getParametersStr(); case GNE_ATTR_ROUTE_DISTRIBUTION: @@ -576,6 +589,7 @@ bool GNERoute::isAttributeEnabled(SumoXMLAttr key) const { switch (key) { case GNE_ATTR_ROUTE_DISTRIBUTION: + case SUMO_ATTR_PROB: return false; default: return true; @@ -593,6 +607,7 @@ GNERoute::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* u case SUMO_ATTR_COLOR: case SUMO_ATTR_REPEAT: case SUMO_ATTR_CYCLETIME: + case SUMO_ATTR_PROB: case GNE_ATTR_PARAMETERS: GNEChange_Attribute::changeAttribute(this, key, value, undoList); break; @@ -659,6 +674,8 @@ GNERoute::isValid(SumoXMLAttr key, const std::string& value) { } else { return false; } + case SUMO_ATTR_PROB: + return canParse(value) && (parse(value) >= 0); case GNE_ATTR_PARAMETERS: return Parameterised::areParametersValid(value); default: @@ -834,6 +851,9 @@ GNERoute::setAttribute(SumoXMLAttr key, const std::string& value) { case SUMO_ATTR_CYCLETIME: myCycleTime = string2time(value); break; + case SUMO_ATTR_PROB: + myProbability = parse(value); + break; case GNE_ATTR_PARAMETERS: setParametersStr(value); break; diff --git a/src/netedit/elements/demand/GNERoute.h b/src/netedit/elements/demand/GNERoute.h index 977d5a48d96d..1e06a7262671 100644 --- a/src/netedit/elements/demand/GNERoute.h +++ b/src/netedit/elements/demand/GNERoute.h @@ -85,10 +85,11 @@ class GNERoute : public GNEDemandElement, public Parameterised { * @param[in] color route color * @param[in] repeat the number of times that the edges of this route shall be repeated * @param[in] cycleType the times will be shifted forward by 'cycleTime' on each repeat + * @param[in] probability used in routeDistributions * @param[in] parameters generic parameters */ GNERoute(GNENet* net, const std::string& id, SUMOVehicleClass vClass, const std::vector& edges, const RGBColor& color, - const int repeat, const SUMOTime cycleTime, const Parameterised::Map& parameters); + const int repeat, const SUMOTime cycleTime, const double probability, const Parameterised::Map& parameters); /**@brief parameter constructor for embedded routes * @param[in] viewNet view in which this Route is placed @@ -97,10 +98,11 @@ class GNERoute : public GNEDemandElement, public Parameterised { * @param[in] color route color * @param[in] repeat the number of times that the edges of this route shall be repeated * @param[in] cycleType the times will be shifted forward by 'cycleTime' on each repeat + * @param[in] probability used in routeDistributions * @param[in] parameters generic parameters */ GNERoute(GNENet* net, GNEDemandElement* vehicleParent, const std::vector& edges, const RGBColor& color, - const int repeat, const SUMOTime cycleTime, const Parameterised::Map& parameters); + const int repeat, const SUMOTime cycleTime, const double probability, const Parameterised::Map& parameters); /// @brief destructor ~GNERoute(); @@ -275,6 +277,9 @@ class GNERoute : public GNEDemandElement, public Parameterised { /// @brief cycleTime SUMOTime myCycleTime; + /// @brief probability + double myProbability; + /// @brief SUMOVehicleClass (Only used for drawing) SUMOVehicleClass myVClass; diff --git a/src/netedit/elements/demand/GNERouteHandler.cpp b/src/netedit/elements/demand/GNERouteHandler.cpp index 69cacf7fa8e1..1a3b7acb6f0e 100644 --- a/src/netedit/elements/demand/GNERouteHandler.cpp +++ b/src/netedit/elements/demand/GNERouteHandler.cpp @@ -192,7 +192,7 @@ GNERouteHandler::buildRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseOb return writeErrorEmptyEdges(SUMO_TAG_ROUTE, id); } else { // create GNERoute - GNEDemandElement* route = new GNERoute(myNet, id, vClass, edges, color, repeat, cycleTime, routeParameters); + GNEDemandElement* route = new GNERoute(myNet, id, vClass, edges, color, repeat, cycleTime, probability, routeParameters); // check if add this route to a distribution GNEDemandElement* routeDistribution = nullptr; if (sumoBaseObject && sumoBaseObject->getParentSumoBaseObject() && sumoBaseObject->getParentSumoBaseObject()->getTag() == SUMO_TAG_ROUTE_DISTRIBUTION) { @@ -323,7 +323,7 @@ GNERouteHandler::buildVehicleEmbeddedRoute(const CommonXMLStructure::SumoBaseObj // create vehicle using vehicleParameters GNEDemandElement* vehicle = new GNEVehicle(GNE_TAG_VEHICLE_WITHROUTE, myNet, type, vehicleParameters); // create embedded route - GNEDemandElement* route = new GNERoute(myNet, vehicle, edges, color, repeat, cycleTime, routeParameters); + GNEDemandElement* route = new GNERoute(myNet, vehicle, edges, color, repeat, cycleTime, probability, routeParameters); if (myAllowUndoRedo) { myNet->getViewNet()->getUndoList()->begin(vehicle, TL("add ") + vehicle->getTagStr() + " '" + vehicleParameters.id + "'"); myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vehicle, true), true); @@ -413,7 +413,7 @@ GNERouteHandler::buildFlowEmbeddedRoute(const CommonXMLStructure::SumoBaseObject // create vehicle using vehicleParameters GNEDemandElement* vehicle = new GNEVehicle(GNE_TAG_FLOW_WITHROUTE, myNet, type, vehicleParameters); // create embedded route - GNEDemandElement* route = new GNERoute(myNet, vehicle, edges, color, repeat, cycleTime, routeParameters); + GNEDemandElement* route = new GNERoute(myNet, vehicle, edges, color, repeat, cycleTime, probability, routeParameters); if (myAllowUndoRedo) { myNet->getViewNet()->getUndoList()->begin(vehicle, TL("add ") + vehicle->getTagStr() + " '" + vehicleParameters.id + "'"); myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vehicle, true), true); @@ -1652,14 +1652,14 @@ GNERouteHandler::transformToVehicle(GNEVehicle* originalVehicle, bool createEmbe // change tag in vehicle parameters vehicleParameters.tag = GNE_TAG_VEHICLE_WITHROUTE; // build embedded route - routeHandler.buildVehicleEmbeddedRoute(nullptr, vehicleParameters, edgeIDs, RGBColor::INVISIBLE, 0, 0, 0, {}); + routeHandler.buildVehicleEmbeddedRoute(nullptr, vehicleParameters, edgeIDs, RGBColor::INVISIBLE, 0, 0, 1.0, {}); } else { // change tag in vehicle parameters vehicleParameters.tag = SUMO_TAG_VEHICLE; // generate route ID const std::string routeID = net->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_ROUTE); // build route - routeHandler.buildRoute(nullptr, routeID, vClass, edgeIDs, routeColor, false, 0, 0, {}); + routeHandler.buildRoute(nullptr, routeID, vClass, edgeIDs, routeColor, false, 0, 1.0, {}); // set route ID in vehicle parameters vehicleParameters.routeid = routeID; // create vehicle @@ -1746,14 +1746,14 @@ GNERouteHandler::transformToRouteFlow(GNEVehicle* originalVehicle, bool createEm // change tag in vehicle parameters vehicleParameters.tag = GNE_TAG_FLOW_WITHROUTE; // build embedded route - routeHandler.buildFlowEmbeddedRoute(nullptr, vehicleParameters, edgeIDs, RGBColor::INVISIBLE, 0, 0, 0, {}); + routeHandler.buildFlowEmbeddedRoute(nullptr, vehicleParameters, edgeIDs, RGBColor::INVISIBLE, 0, 0, 1.0, {}); } else { // change tag in vehicle parameters vehicleParameters.tag = SUMO_TAG_FLOW; // generate a new route id const std::string routeID = net->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_ROUTE); // build route - routeHandler.buildRoute(nullptr, routeID, vClass, edgeIDs, routeColor, false, 0, 0, {}); + routeHandler.buildRoute(nullptr, routeID, vClass, edgeIDs, routeColor, false, 0, 1.0, {}); // set route ID in vehicle parameters vehicleParameters.routeid = routeID; // create vehicle diff --git a/src/utils/handlers/RouteHandler.cpp b/src/utils/handlers/RouteHandler.cpp index 2ad5c7689f4a..651344abe6e8 100644 --- a/src/utils/handlers/RouteHandler.cpp +++ b/src/utils/handlers/RouteHandler.cpp @@ -491,7 +491,7 @@ RouteHandler::parseRoute(const SUMOSAXAttributes& attrs) { const RGBColor color = attrs.getOpt(SUMO_ATTR_COLOR, id.c_str(), parsedOk, RGBColor::INVISIBLE); const int repeat = attrs.getOpt(SUMO_ATTR_REPEAT, id.c_str(), parsedOk, 0); const SUMOTime cycleTime = attrs.getOptSUMOTimeReporting(SUMO_ATTR_CYCLETIME, id.c_str(), parsedOk, 0); - const double probability = attrs.getOpt(SUMO_ATTR_PROB, id.c_str(), parsedOk, 0); + const double probability = attrs.getOpt(SUMO_ATTR_PROB, id.c_str(), parsedOk, 1.0); // check attributes if (!checkNegative(SUMO_TAG_ROUTE, id, SUMO_ATTR_CYCLETIME, cycleTime, true)) { parsedOk = false; From cde447964016c41598cebf2b96bda665538a42d6 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Thu, 23 Jan 2025 13:13:38 +0100 Subject: [PATCH 112/116] Added new checks in RouteHandler. Refs #16027 --- src/utils/handlers/CommonHandler.cpp | 48 +++++++++++++++ src/utils/handlers/CommonHandler.h | 9 +++ src/utils/handlers/RouteHandler.cpp | 88 ++++++++++++++++------------ 3 files changed, 107 insertions(+), 38 deletions(-) diff --git a/src/utils/handlers/CommonHandler.cpp b/src/utils/handlers/CommonHandler.cpp index d3bb33fd729a..bc0950622b21 100644 --- a/src/utils/handlers/CommonHandler.cpp +++ b/src/utils/handlers/CommonHandler.cpp @@ -162,6 +162,54 @@ CommonHandler::checkVehicleParents(CommonXMLStructure::SumoBaseObject* obj) { } +bool +CommonHandler::checkPersonPlanParents(CommonXMLStructure::SumoBaseObject* obj) { + const auto parent = obj->getParentSumoBaseObject(); + if (parent == nullptr) { + return false; + } else if (!parent->wasCreated()) { + return false; + } else if ((parent->getTag() == SUMO_TAG_PERSON) || (parent->getTag() == SUMO_TAG_PERSONFLOW)) { + return true; + } else { + return false; + } +} + + +bool +CommonHandler::checkContainerPlanParents(CommonXMLStructure::SumoBaseObject* obj) { + const auto parent = obj->getParentSumoBaseObject(); + if (parent == nullptr) { + return false; + } else if (!parent->wasCreated()) { + return false; + } else if ((parent->getTag() == SUMO_TAG_CONTAINER) || (parent->getTag() == SUMO_TAG_CONTAINERFLOW)) { + return true; + } else { + return false; + } +} + + +bool +CommonHandler::checkStopParents(CommonXMLStructure::SumoBaseObject* obj) { + const auto parent = obj->getParentSumoBaseObject(); + if (parent == nullptr) { + return false; + } else if (!parent->wasCreated()) { + return false; + } else if ((parent->getTag() == SUMO_TAG_ROUTE) || (parent->getTag() == SUMO_TAG_TRIP) || + (parent->getTag() == SUMO_TAG_VEHICLE) || (parent->getTag() == SUMO_TAG_FLOW) || + (parent->getTag() == SUMO_TAG_PERSON) || (parent->getTag() == SUMO_TAG_PERSONFLOW) || + (parent->getTag() == SUMO_TAG_CONTAINER) || (parent->getTag() == SUMO_TAG_CONTAINERFLOW)) { + return true; + } else { + return false; + } +} + + bool CommonHandler::checkNegative(const SumoXMLTag tag, const std::string& id, const SumoXMLAttr attribute, const int value, const bool canBeZero) { if (canBeZero) { diff --git a/src/utils/handlers/CommonHandler.h b/src/utils/handlers/CommonHandler.h index ee761dad6977..e38591937d11 100644 --- a/src/utils/handlers/CommonHandler.h +++ b/src/utils/handlers/CommonHandler.h @@ -71,6 +71,15 @@ class CommonHandler { /// @brief check vehicle parents bool checkVehicleParents(CommonXMLStructure::SumoBaseObject* obj); + /// @brief check person plan parents + bool checkPersonPlanParents(CommonXMLStructure::SumoBaseObject* obj); + + /// @brief check container plan parents + bool checkContainerPlanParents(CommonXMLStructure::SumoBaseObject* obj); + + /// @brief check stop parents + bool checkStopParents(CommonXMLStructure::SumoBaseObject* obj); + /// @brief check if the given int value is NOT negative bool checkNegative(const SumoXMLTag tag, const std::string& id, const SumoXMLAttr attribute, const int value, const bool canBeZero); diff --git a/src/utils/handlers/RouteHandler.cpp b/src/utils/handlers/RouteHandler.cpp index 651344abe6e8..435495aa9f60 100644 --- a/src/utils/handlers/RouteHandler.cpp +++ b/src/utils/handlers/RouteHandler.cpp @@ -346,33 +346,39 @@ RouteHandler::parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj) { break; // person plans case SUMO_TAG_PERSONTRIP: - if (buildPersonTrip(obj, - obj->getPlanParameters(), - obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), - obj->getStringListAttribute(SUMO_ATTR_VTYPES), - obj->getStringListAttribute(SUMO_ATTR_MODES), - obj->getStringListAttribute(SUMO_ATTR_LINES), - obj->getDoubleAttribute(SUMO_ATTR_WALKFACTOR), - obj->getStringAttribute(SUMO_ATTR_GROUP))) { - obj->markAsCreated(); + if (checkPersonPlanParents(obj)) { + if (buildPersonTrip(obj, + obj->getPlanParameters(), + obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), + obj->getStringListAttribute(SUMO_ATTR_VTYPES), + obj->getStringListAttribute(SUMO_ATTR_MODES), + obj->getStringListAttribute(SUMO_ATTR_LINES), + obj->getDoubleAttribute(SUMO_ATTR_WALKFACTOR), + obj->getStringAttribute(SUMO_ATTR_GROUP))) { + obj->markAsCreated(); + } } break; case SUMO_TAG_RIDE: - if (buildRide(obj, - obj->getPlanParameters(), - obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), - obj->getStringListAttribute(SUMO_ATTR_LINES), - obj->getStringAttribute(SUMO_ATTR_GROUP))) { - obj->markAsCreated(); + if (checkPersonPlanParents(obj)) { + if (buildRide(obj, + obj->getPlanParameters(), + obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), + obj->getStringListAttribute(SUMO_ATTR_LINES), + obj->getStringAttribute(SUMO_ATTR_GROUP))) { + obj->markAsCreated(); + } } break; case SUMO_TAG_WALK: - if (buildWalk(obj, - obj->getPlanParameters(), - obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), - obj->getDoubleAttribute(SUMO_ATTR_SPEED), - obj->getTimeAttribute(SUMO_ATTR_DURATION))) { - obj->markAsCreated(); + if (checkPersonPlanParents(obj)) { + if (buildWalk(obj, + obj->getPlanParameters(), + obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), + obj->getDoubleAttribute(SUMO_ATTR_SPEED), + obj->getTimeAttribute(SUMO_ATTR_DURATION))) { + obj->markAsCreated(); + } } break; // container @@ -390,30 +396,36 @@ RouteHandler::parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj) { break; // container plans case SUMO_TAG_TRANSPORT: - if (buildTransport(obj, - obj->getPlanParameters(), - obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), - obj->getStringListAttribute(SUMO_ATTR_LINES), - obj->getStringAttribute(SUMO_ATTR_GROUP))) { - obj->markAsCreated(); + if (checkContainerPlanParents(obj)) { + if (buildTransport(obj, + obj->getPlanParameters(), + obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), + obj->getStringListAttribute(SUMO_ATTR_LINES), + obj->getStringAttribute(SUMO_ATTR_GROUP))) { + obj->markAsCreated(); + } } break; case SUMO_TAG_TRANSHIP: - if (buildTranship(obj, - obj->getPlanParameters(), - obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), - obj->getDoubleAttribute(SUMO_ATTR_DEPARTPOS), - obj->getDoubleAttribute(SUMO_ATTR_SPEED), - obj->getTimeAttribute(SUMO_ATTR_DURATION))) { - obj->markAsCreated(); + if (checkContainerPlanParents(obj)) { + if (buildTranship(obj, + obj->getPlanParameters(), + obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), + obj->getDoubleAttribute(SUMO_ATTR_DEPARTPOS), + obj->getDoubleAttribute(SUMO_ATTR_SPEED), + obj->getTimeAttribute(SUMO_ATTR_DURATION))) { + obj->markAsCreated(); + } } break; // stops case SUMO_TAG_STOP: - if (buildStop(obj, - obj->getPlanParameters(), - obj->getStopParameter())) { - obj->markAsCreated(); + if (checkStopParents(obj)) { + if (buildStop(obj, + obj->getPlanParameters(), + obj->getStopParameter())) { + obj->markAsCreated(); + } } break; default: From e0b919ee18b45d36c2137216e464706bbf5a5367 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Thu, 23 Jan 2025 13:56:11 +0100 Subject: [PATCH 113/116] Updated creation of embedded routes. Refs #16027 --- src/netedit/frames/demand/GNEVehicleFrame.cpp | 24 +++++++++---------- src/utils/handlers/CommonHandler.cpp | 20 ++++++++++++---- src/utils/handlers/CommonHandler.h | 3 +++ src/utils/handlers/RouteHandler.cpp | 12 ---------- src/utils/handlers/RouteHandler.h | 3 --- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/netedit/frames/demand/GNEVehicleFrame.cpp b/src/netedit/frames/demand/GNEVehicleFrame.cpp index 3426db95bc7b..fdaafe178c5e 100644 --- a/src/netedit/frames/demand/GNEVehicleFrame.cpp +++ b/src/netedit/frames/demand/GNEVehicleFrame.cpp @@ -380,13 +380,13 @@ GNEVehicleFrame::createPath(const bool useLastRoute) { // create route base object CommonXMLStructure::SumoBaseObject* embeddedRouteObject = new CommonXMLStructure::SumoBaseObject(myVehicleBaseObject); embeddedRouteObject->setTag(SUMO_TAG_ROUTE); - embeddedRouteObject->addStringAttribute(SUMO_ATTR_ID, ""); embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges); - embeddedRouteObject->addColorAttribute(SUMO_ATTR_COLOR, RGBColor::INVISIBLE), - embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0), - embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0), - // parse route - myRouteHandler.parseSumoBaseObject(embeddedRouteObject); + embeddedRouteObject->addColorAttribute(SUMO_ATTR_COLOR, RGBColor::INVISIBLE); + embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0); + embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0); + embeddedRouteObject->addDoubleAttribute(SUMO_ATTR_PROB, 1.0); + // parse route + myRouteHandler.parseSumoBaseObject(myVehicleBaseObject); // delete vehicleParamters delete vehicleParameters; } @@ -446,13 +446,13 @@ GNEVehicleFrame::createPath(const bool useLastRoute) { // create under base object CommonXMLStructure::SumoBaseObject* embeddedRouteObject = new CommonXMLStructure::SumoBaseObject(myVehicleBaseObject); embeddedRouteObject->setTag(SUMO_TAG_ROUTE); - embeddedRouteObject->addStringAttribute(SUMO_ATTR_ID, ""); embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges); - embeddedRouteObject->addColorAttribute(SUMO_ATTR_COLOR, RGBColor::INVISIBLE), - embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0), - embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0), - // parse route - myRouteHandler.parseSumoBaseObject(embeddedRouteObject); + embeddedRouteObject->addColorAttribute(SUMO_ATTR_COLOR, RGBColor::INVISIBLE); + embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0); + embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0); + embeddedRouteObject->addDoubleAttribute(SUMO_ATTR_PROB, 1.0); + // parse route + myRouteHandler.parseSumoBaseObject(myVehicleBaseObject); // delete vehicleParamters delete flowParameters; } diff --git a/src/utils/handlers/CommonHandler.cpp b/src/utils/handlers/CommonHandler.cpp index bc0950622b21..ff96d1dc782f 100644 --- a/src/utils/handlers/CommonHandler.cpp +++ b/src/utils/handlers/CommonHandler.cpp @@ -75,6 +75,18 @@ CommonHandler::parseParameters(const SUMOSAXAttributes& attrs) { } +CommonXMLStructure::SumoBaseObject* +CommonHandler::getEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const { + // locate route in childrens + for (const auto &embeddedRoute : sumoBaseObject->getSumoBaseObjectChildren()) { + if ((embeddedRoute->getTag() == SUMO_TAG_ROUTE) && (!embeddedRoute->hasStringAttribute(SUMO_ATTR_ID))) { + return embeddedRoute; + } + } + return nullptr; +} + + void CommonHandler::checkParsedParent(const SumoXMLTag currentTag, const std::vector& parentTags, bool& ok) { if (parentTags.size() > 0) { @@ -141,20 +153,20 @@ CommonHandler::checkVehicleParents(CommonXMLStructure::SumoBaseObject* obj) { SumoXMLTag tag = obj->getTag(); const std::string id = obj->getStringAttribute(SUMO_ATTR_ID); const bool hasRoute = obj->hasStringAttribute(SUMO_ATTR_ROUTE); - const bool embeddedRoute = (obj->getSumoBaseObjectChildren().size() > 0) && (obj->getSumoBaseObjectChildren().front()->getTag() == SUMO_TAG_ROUTE); + const bool hasEmbeddedRoute = (getEmbeddedRoute(obj) != nullptr); const bool overEdges = obj->hasStringAttribute(SUMO_ATTR_FROM) && obj->hasStringAttribute(SUMO_ATTR_TO); const bool overJunctions = obj->hasStringAttribute(SUMO_ATTR_FROM_JUNCTION) && obj->hasStringAttribute(SUMO_ATTR_TO_JUNCTION); const bool overTAZs = obj->hasStringAttribute(SUMO_ATTR_FROM_TAZ) && obj->hasStringAttribute(SUMO_ATTR_TO_TAZ); - if (hasRoute && embeddedRoute) { + if (hasRoute && hasEmbeddedRoute) { return writeError(TLF("Could not build % with ID '%' in netedit; Cannot have an external route and an embedded route in the same definition.", toString(tag), id)); } if ((overEdges + overJunctions + overTAZs) > 1) { return writeError(TLF("Could not build % with ID '%' in netedit; Cannot have multiple from-to attributes.", toString(tag), id)); } - if ((hasRoute + embeddedRoute + overEdges + overJunctions + overTAZs) > 1) { + if ((hasRoute + hasEmbeddedRoute + overEdges + overJunctions + overTAZs) > 1) { return writeError(TLF("Could not build % with ID '%' in netedit; Cannot have from-to attributes and route attributes in the same definition.", toString(tag), id)); } - if ((hasRoute + embeddedRoute + overEdges + overJunctions + overTAZs) == 0) { + if ((hasRoute + hasEmbeddedRoute + overEdges + overJunctions + overTAZs) == 0) { return writeError(TLF("Could not build % with ID '%' in netedit; Requiere either a route or an embedded route or a from-to attribute (Edges, junctions or TAZs).", toString(tag), id)); } return true; diff --git a/src/utils/handlers/CommonHandler.h b/src/utils/handlers/CommonHandler.h index e38591937d11..47b189bc7db6 100644 --- a/src/utils/handlers/CommonHandler.h +++ b/src/utils/handlers/CommonHandler.h @@ -56,6 +56,9 @@ class CommonHandler { /// @brief parse generic parameters void parseParameters(const SUMOSAXAttributes& attrs); + /// @brief get embedded route from children + CommonXMLStructure::SumoBaseObject* getEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const; + /// @name check functions /// @{ diff --git a/src/utils/handlers/RouteHandler.cpp b/src/utils/handlers/RouteHandler.cpp index 435495aa9f60..c2af8db6664b 100644 --- a/src/utils/handlers/RouteHandler.cpp +++ b/src/utils/handlers/RouteHandler.cpp @@ -1243,16 +1243,4 @@ RouteHandler::isOverFromToTAZs(const CommonXMLStructure::SumoBaseObject* sumoBas return sumoBaseObject->hasStringAttribute(SUMO_ATTR_FROM_TAZ) && sumoBaseObject->hasStringAttribute(SUMO_ATTR_TO_TAZ); } - -CommonXMLStructure::SumoBaseObject* -RouteHandler::getEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const { - // locate route in childrens - for (const auto &embeddedRoute : sumoBaseObject->getSumoBaseObjectChildren()) { - if ((embeddedRoute->getTag() == SUMO_TAG_ROUTE) && (!embeddedRoute->hasStringAttribute(SUMO_ATTR_ID))) { - return embeddedRoute; - } - } - return nullptr; -} - /****************************************************************************/ diff --git a/src/utils/handlers/RouteHandler.h b/src/utils/handlers/RouteHandler.h index 0160f1660b26..57a40b500884 100644 --- a/src/utils/handlers/RouteHandler.h +++ b/src/utils/handlers/RouteHandler.h @@ -241,9 +241,6 @@ class RouteHandler : public CommonHandler { /// @brief check if element is defined over from-to junctions bool isOverFromToTAZs(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const; - /// @brief get embedded route from children - CommonXMLStructure::SumoBaseObject* getEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const; - /// @} /// @brief invalidate copy constructor From 73f612dd04c4a1640ab270ff2e087b5cec9bcb70 Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Thu, 23 Jan 2025 14:22:28 +0100 Subject: [PATCH 114/116] Fixed error loading embedded routes. Refs #16027 --- src/utils/handlers/RouteHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/handlers/RouteHandler.cpp b/src/utils/handlers/RouteHandler.cpp index c2af8db6664b..c86e8fb3faf6 100644 --- a/src/utils/handlers/RouteHandler.cpp +++ b/src/utils/handlers/RouteHandler.cpp @@ -153,6 +153,10 @@ RouteHandler::endParseAttributes() { myCommonXMLStructure.closeSUMOBaseOBject(); switch (obj->getTag()) { case SUMO_TAG_ROUTE: + // special case for embedded routes + if (!obj->hasStringAttribute(SUMO_ATTR_ID)) { + break; + } case SUMO_TAG_VTYPE: case SUMO_TAG_VTYPE_DISTRIBUTION: case SUMO_TAG_ROUTE_DISTRIBUTION: From ca07eb1cfab8c850e1710da5fe52457e4351ffbb Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Thu, 23 Jan 2025 15:38:17 +0100 Subject: [PATCH 115/116] Updated error message during loading of invalid routes. Refs #16027 --- src/utils/handlers/RouteHandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/handlers/RouteHandler.cpp b/src/utils/handlers/RouteHandler.cpp index c86e8fb3faf6..d727f4dc09f7 100644 --- a/src/utils/handlers/RouteHandler.cpp +++ b/src/utils/handlers/RouteHandler.cpp @@ -493,8 +493,10 @@ RouteHandler::parseRoute(const SUMOSAXAttributes& attrs) { // get embedded route flag const bool embeddedRoute = isEmbeddedRoute(attrs); // first check if this is an embedded route - if ((embeddedRoute && attrs.hasAttribute(SUMO_ATTR_ID)) || (!embeddedRoute && !attrs.hasAttribute(SUMO_ATTR_ID))) { - writeError(TL("a route must be defined either within a vehicle/flow or with an ID attribute")); + if (embeddedRoute && attrs.hasAttribute(SUMO_ATTR_ID)) { + writeError(TL("an embedded route cannot have their own ID")); + } else if (!embeddedRoute && !attrs.hasAttribute(SUMO_ATTR_ID)) { + writeError(TL("a non-embedded route requieres their own ID")); } else { // declare Ok Flag bool parsedOk = true; From a22aa75883f16ed44430d8fda9f45a075c0aee4f Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Thu, 23 Jan 2025 16:22:16 +0100 Subject: [PATCH 116/116] Added function checkOverwritteElement. Refs #16027 --- .../elements/demand/GNERouteHandler.cpp | 50 +++++++++++++++++-- src/netedit/elements/demand/GNERouteHandler.h | 3 ++ src/netedit/elements/network/GNEEdge.cpp | 6 +-- src/utils/handlers/CommonHandler.cpp | 6 +++ src/utils/handlers/CommonHandler.h | 5 +- 5 files changed, 63 insertions(+), 7 deletions(-) diff --git a/src/netedit/elements/demand/GNERouteHandler.cpp b/src/netedit/elements/demand/GNERouteHandler.cpp index 1a3b7acb6f0e..af070f99ce38 100644 --- a/src/netedit/elements/demand/GNERouteHandler.cpp +++ b/src/netedit/elements/demand/GNERouteHandler.cpp @@ -180,6 +180,8 @@ bool GNERouteHandler::buildRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, SUMOVehicleClass vClass, const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, const double probability, const Parameterised::Map& routeParameters) { + // first check if we have to overwritte element + checkOverwritteElement({SUMO_TAG_ROUTE}, id); // check conditions if (!checkValidDemandElementID(SUMO_TAG_ROUTE, id)) { return false; @@ -259,6 +261,8 @@ GNERouteHandler::buildRouteDistribution(const CommonXMLStructure::SumoBaseObject bool GNERouteHandler::buildVehicleOverRoute(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters) { + // first check if we have to overwritte element + checkOverwritteElement(myVehicleTags, vehicleParameters.id); // first check if ID is duplicated if (!checkValidDemandElementID(SUMO_TAG_VEHICLE, vehicleParameters.id)) { return false; @@ -300,6 +304,8 @@ bool GNERouteHandler::buildVehicleEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, const double probability, const Parameterised::Map& routeParameters) { + // first check if we have to overwritte element + checkOverwritteElement(myVehicleTags, vehicleParameters.id); // check if ID is duplicated if (!checkValidDemandElementID(GNE_TAG_VEHICLE_WITHROUTE, vehicleParameters.id)) { return false; @@ -349,6 +355,8 @@ GNERouteHandler::buildVehicleEmbeddedRoute(const CommonXMLStructure::SumoBaseObj bool GNERouteHandler::buildFlowOverRoute(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters) { + // first check if we have to overwritte element + checkOverwritteElement(myVehicleTags, vehicleParameters.id); // first check if ID is duplicated if (!checkValidDemandElementID(GNE_TAG_FLOW_ROUTE, vehicleParameters.id)) { return false; @@ -390,6 +398,8 @@ bool GNERouteHandler::buildFlowEmbeddedRoute(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, const std::vector& edgeIDs, const RGBColor& color, const int repeat, const SUMOTime cycleTime, const double probability, const Parameterised::Map& routeParameters) { + // first check if we have to overwritte element + checkOverwritteElement(myVehicleTags, vehicleParameters.id); // check if ID is duplicated if (!checkValidDemandElementID(GNE_TAG_FLOW_WITHROUTE, vehicleParameters.id)) { return false; @@ -440,7 +450,8 @@ GNERouteHandler::buildFlowEmbeddedRoute(const CommonXMLStructure::SumoBaseObject bool GNERouteHandler::buildTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, const std::string& fromEdgeID, const std::string& toEdgeID) { - + // first check if we have to overwritte element + checkOverwritteElement(myVehicleTags, vehicleParameters.id); // set via attribute if (sumoBaseObject && sumoBaseObject->hasStringListAttribute(SUMO_ATTR_VIA)) { vehicleParameters.via = sumoBaseObject->getStringListAttribute(SUMO_ATTR_VIA); @@ -493,7 +504,8 @@ GNERouteHandler::buildTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObj bool GNERouteHandler::buildTripJunctions(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, const std::string& fromJunctionID, const std::string& toJunctionID) { - + // first check if we have to overwritte element + checkOverwritteElement(myVehicleTags, vehicleParameters.id); // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) if (!checkValidDemandElementID(GNE_TAG_TRIP_JUNCTIONS, vehicleParameters.id)) { return false; @@ -540,6 +552,8 @@ GNERouteHandler::buildTripJunctions(const CommonXMLStructure::SumoBaseObject* /* bool GNERouteHandler::buildTripTAZs(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, const std::string& fromTAZID, const std::string& toTAZID) { + // first check if we have to overwritte element + checkOverwritteElement(myVehicleTags, vehicleParameters.id); // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) if (!checkValidDemandElementID(GNE_TAG_TRIP_TAZS, vehicleParameters.id)) { return false; @@ -586,7 +600,8 @@ GNERouteHandler::buildTripTAZs(const CommonXMLStructure::SumoBaseObject* /*sumoB bool GNERouteHandler::buildFlow(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, const std::string& fromEdgeID, const std::string& toEdgeID) { - + // first check if we have to overwritte element + checkOverwritteElement(myVehicleTags, vehicleParameters.id); // set via attribute if (sumoBaseObject && sumoBaseObject->hasStringListAttribute(SUMO_ATTR_VIA)) { vehicleParameters.via = sumoBaseObject->getStringListAttribute(SUMO_ATTR_VIA); @@ -639,6 +654,8 @@ GNERouteHandler::buildFlow(const CommonXMLStructure::SumoBaseObject* sumoBaseObj bool GNERouteHandler::buildFlowJunctions(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, const std::string& fromJunctionID, const std::string& toJunctionID) { + // first check if we have to overwritte element + checkOverwritteElement(myVehicleTags, vehicleParameters.id); // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) if (!checkValidDemandElementID(GNE_TAG_FLOW_JUNCTIONS, vehicleParameters.id)) { return false; @@ -685,6 +702,8 @@ GNERouteHandler::buildFlowJunctions(const CommonXMLStructure::SumoBaseObject* /* bool GNERouteHandler::buildFlowTAZs(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, const std::string& fromTAZID, const std::string& toTAZID) { + // first check if we have to overwritte element + checkOverwritteElement(myVehicleTags, vehicleParameters.id); // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) if (!checkValidDemandElementID(GNE_TAG_FLOW_TAZS, vehicleParameters.id)) { return false; @@ -730,6 +749,8 @@ GNERouteHandler::buildFlowTAZs(const CommonXMLStructure::SumoBaseObject* /*sumoB bool GNERouteHandler::buildPerson(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& personParameters) { + // first check if we have to overwritte element + checkOverwritteElement(myPersonTags, personParameters.id); // first check if ID is duplicated if (!checkValidDemandElementID(SUMO_TAG_PERSON, personParameters.id)) { return false; @@ -763,6 +784,8 @@ GNERouteHandler::buildPerson(const CommonXMLStructure::SumoBaseObject* /*sumoBas bool GNERouteHandler::buildPersonFlow(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& personFlowParameters) { + // first check if we have to overwritte element + checkOverwritteElement(myPersonTags, personFlowParameters.id); // first check if ID is duplicated if (!checkValidDemandElementID(SUMO_TAG_PERSONFLOW, personFlowParameters.id)) { return false; @@ -904,6 +927,8 @@ GNERouteHandler::buildRide(const CommonXMLStructure::SumoBaseObject* sumoBaseObj bool GNERouteHandler::buildContainer(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& containerParameters) { + // first check if we have to overwritte element + checkOverwritteElement(myPersonTags, containerParameters.id); // first check if ID is duplicated if (!checkValidDemandElementID(SUMO_TAG_CONTAINER, containerParameters.id)) { return false; @@ -937,6 +962,8 @@ GNERouteHandler::buildContainer(const CommonXMLStructure::SumoBaseObject* /*sumo bool GNERouteHandler::buildContainerFlow(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& containerFlowParameters) { + // first check if we have to overwritte element + checkOverwritteElement(myPersonTags, containerFlowParameters.id); // first check if ID is duplicated if (!checkValidDemandElementID(SUMO_TAG_CONTAINERFLOW, containerFlowParameters.id)) { return false; @@ -2618,4 +2645,21 @@ GNERouteHandler::checkDuplicatedDemandElement(const SumoXMLTag tag, const std::v return true; } + +void +GNERouteHandler::checkOverwritteElement(const std::vector &tags, const std::string &id) { + if (myOverwrite) { + // retrieve demand element and remove it + for (const auto &tag : tags) { + auto demandElement = myNet->getAttributeCarriers()->retrieveDemandElement(tag, id, false); + if (demandElement) { + writeWarningOverwritting(tag, id); + myNet->getViewNet()->getUndoList()->begin(demandElement, TL("delete ") + demandElement->getTagStr() + " '" + id + "'"); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(demandElement, false), true); + myNet->getViewNet()->getUndoList()->end(); + } + } + } +} + /****************************************************************************/ diff --git a/src/netedit/elements/demand/GNERouteHandler.h b/src/netedit/elements/demand/GNERouteHandler.h index 1a69ab54e09e..46483cbbae6b 100644 --- a/src/netedit/elements/demand/GNERouteHandler.h +++ b/src/netedit/elements/demand/GNERouteHandler.h @@ -292,6 +292,9 @@ class GNERouteHandler : public RouteHandler { /// @brief check if given ID correspond to a duplicated demand element bool checkDuplicatedDemandElement(const SumoXMLTag tag, const std::vector tags, const std::string& id); + /// @brief check if + void checkOverwritteElement(const std::vector &tags, const std::string &id); + private: /// @brief pointer to GNENet GNENet* myNet; diff --git a/src/netedit/elements/network/GNEEdge.cpp b/src/netedit/elements/network/GNEEdge.cpp index b209bba1b52a..374d9c874adf 100644 --- a/src/netedit/elements/network/GNEEdge.cpp +++ b/src/netedit/elements/network/GNEEdge.cpp @@ -2510,7 +2510,7 @@ GNEEdge::getVehiclesOverEdgeMap() const { vehicles.insert(std::make_pair(routeChild->getAttributeDouble(SUMO_ATTR_DEPART), routeChild)); } } - } else if ((edgeChild->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED) && (edgeChild->getParentEdges().front() == this)) { + } else if ((edgeChild->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED) && (edgeChild->getParentEdges().front() == this) && (edgeChild->getParentDemandElements().size() > 0)) { vehicles.insert(std::make_pair(edgeChild->getParentDemandElements().front()->getAttributeDouble(SUMO_ATTR_DEPART), edgeChild->getParentDemandElements().front())); } } @@ -2542,7 +2542,7 @@ GNEEdge::getPersonsOverEdgeMap() const { std::set > persons; // first obtain all persons of this edge for (const auto& edgeChild : getChildDemandElements()) { - if (edgeChild->getTagProperty().isPlanPerson()) { + if (edgeChild->getTagProperty().isPlanPerson() && (edgeChild->getParentDemandElements().size() > 0)) { persons.insert(std::make_pair(edgeChild->getParentDemandElements().front()->getAttributeDouble(SUMO_ATTR_DEPARTPOS), edgeChild->getParentDemandElements().front())); } } @@ -2575,7 +2575,7 @@ GNEEdge::getContainersOverEdgeMap() const { std::set > containers; // first obtain all containers of this edge for (const auto& edgeChild : getChildDemandElements()) { - if (edgeChild->getTagProperty().isPlanContainer()) { + if (edgeChild->getTagProperty().isPlanContainer() && (edgeChild->getParentDemandElements().size() > 0)) { containers.insert(std::make_pair(edgeChild->getParentDemandElements().front()->getAttributeDouble(SUMO_ATTR_DEPARTPOS), edgeChild->getParentDemandElements().front())); } } diff --git a/src/utils/handlers/CommonHandler.cpp b/src/utils/handlers/CommonHandler.cpp index ff96d1dc782f..ffbd85e6684d 100644 --- a/src/utils/handlers/CommonHandler.cpp +++ b/src/utils/handlers/CommonHandler.cpp @@ -322,6 +322,12 @@ CommonHandler::checkValidDemandElementID(const SumoXMLTag tag, const std::string } +void +CommonHandler::writeWarningOverwritting(const SumoXMLTag tag, const std::string& id) { + WRITE_WARNING(TLF("Overwritting % with ID '%'", toString(tag), id)); +} + + bool CommonHandler::writeError(const std::string& error) { WRITE_ERROR(error); diff --git a/src/utils/handlers/CommonHandler.h b/src/utils/handlers/CommonHandler.h index 47b189bc7db6..3d8d81480b38 100644 --- a/src/utils/handlers/CommonHandler.h +++ b/src/utils/handlers/CommonHandler.h @@ -106,13 +106,16 @@ class CommonHandler { /// @} + /// @brief write warning overwritting element + void writeWarningOverwritting(const SumoXMLTag tag, const std::string& id); + /// @brief write error and enable error creating element bool writeError(const std::string& error); /// @brief write error "invalid position" bool writeErrorInvalidPosition(const SumoXMLTag tag, const std::string& id); - /// @brief write error "duplicated additional" + /// @brief write error duplicated element bool writeErrorDuplicated(const SumoXMLTag tag, const std::string& id, const SumoXMLTag checkedTag); /// @brief write error "empty edges"